PortalQueryParametersForItems Class

  • PortalQueryParametersForItems
  • class Esri::ArcGISRuntime::PortalQueryParametersForItems

    The query parameters suitable for finding content contained in a portal. More...

    Header: #include <PortalQueryParametersForItems.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::PortalQueryParameters

    Public Functions

    PortalQueryParametersForItems()
    PortalQueryParametersForItems(const QString &query)
    PortalQueryParametersForItems(const QString &query, int limit)
    PortalQueryParametersForItems(const Esri::ArcGISRuntime::Envelope &boundingBox)
    PortalQueryParametersForItems(const QString &query, const Esri::ArcGISRuntime::Envelope &boundingBox)
    PortalQueryParametersForItems(const Esri::ArcGISRuntime::PortalQueryParametersForItems &other)
    PortalQueryParametersForItems(Esri::ArcGISRuntime::PortalQueryParametersForItems &&other)
    PortalQueryParametersForItems(const Esri::ArcGISRuntime::PortalQueryParameters &other)
    virtual ~PortalQueryParametersForItems() override
    QString groupId() const
    QString itemId() const
    QString owner() const
    QString searchString() const
    void setGroupId(const QString &groupId)
    void setItemId(const QString &itemId)
    void setOwner(const QString &owner)
    void setSearchString(const QString &searchString)
    void setTypes(const QList<Esri::ArcGISRuntime::PortalItemType> &types)
    QList<Esri::ArcGISRuntime::PortalItemType> types() const
    Esri::ArcGISRuntime::PortalQueryParametersForItems &operator=(const Esri::ArcGISRuntime::PortalQueryParametersForItems &other)
    Esri::ArcGISRuntime::PortalQueryParametersForItems &operator=(Esri::ArcGISRuntime::PortalQueryParametersForItems &&other)
    Esri::ArcGISRuntime::PortalQueryParametersForItems &operator=(const Esri::ArcGISRuntime::PortalQueryParameters &other)

    Static Public Members

    Esri::ArcGISRuntime::PortalQueryParametersForItems forItemType(Esri::ArcGISRuntime::PortalItemType type, const QString &searchString = QString())
    Esri::ArcGISRuntime::PortalQueryParametersForItems forItemTypeInGroup(Esri::ArcGISRuntime::PortalItemType type, const QString &groupId, const QString &searchString = QString())
    Esri::ArcGISRuntime::PortalQueryParametersForItems forItemTypeWithOwner(Esri::ArcGISRuntime::PortalItemType type, const QString &owner, const QString &searchString = QString())
    Esri::ArcGISRuntime::PortalQueryParametersForItems forItemTypes(const QList<Esri::ArcGISRuntime::PortalItemType> &types, const QString &owner, const QString &groupId, const QString &searchString)
    Esri::ArcGISRuntime::PortalQueryParametersForItems inGroup(const QString &groupId)
    Esri::ArcGISRuntime::PortalQueryParametersForItems withId(const QString &ItemId)
    Esri::ArcGISRuntime::PortalQueryParametersForItems withOwner(const QString &owner)

    Detailed Description

    Methods are provided for a number of particular parameters: groupId, itemId, owner and type. There are also a methods for a searchString that can be a complex expression, containing names and values of one or more fields, for example "owner:username AND title:mygroupname".

    A typical usage pattern is:

    Example: Use query parameters 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 (in milliseconds)
    QString fromDate = QString("000000%1").arg(QDateTime::fromString(QDate(2014, 7, 2).toString()).toMSecsSinceEpoch());
    QString toDate = QString("000000%1").arg(QDateTime::currentDateTime().toMSecsSinceEpoch());
    
    PortalQueryParametersForItems query;
    query.setSearchString(QString("tags:\"%1\" AND +uploaded:[%2 TO %3]")
                          .arg(keyword, fromDate, toDate));
    query.setTypes(QList<PortalItemType>() << PortalItemType::WebMap);
    
    m_portal->findItemsAsync(query).then(
    [this](PortalQueryResultSetForItems* webmapResults)
    {
      onFindItemsCompleted(webmapResults);
    });

    Example: Obtain the next set of query parameters from a result set:

    PortalQueryParametersForItems nextQuery = m_webmapResults->nextQueryParameters();
    // check whether the startIndex of the new query is valid
    if (!nextQuery.isEmpty())
    {
      m_portal->findItemsAsync(nextQuery).then(
      [this](PortalQueryResultSetForItems* webmapResults)
      {
        onFindItemsCompleted(webmapResults);
      });
    }

    Detailed information on search capabilities and syntax can be found in the ArcGIS REST API.

    See also Portal, PortalItem, and PortalQueryResultSetForItems.

    Member Function Documentation

    [explicit] PortalQueryParametersForItems::PortalQueryParametersForItems()

    Default constructor.

    [explicit] PortalQueryParametersForItems::PortalQueryParametersForItems(const QString &query)

    Constructor that accepts a query string.

    [explicit] PortalQueryParametersForItems::PortalQueryParametersForItems(const QString &query, int limit)

    Constructor that accepts a query string and a limit on the number of results to return.

    [explicit] PortalQueryParametersForItems::PortalQueryParametersForItems(const Esri::ArcGISRuntime::Envelope &boundingBox)

    Constructor that accepts a bounding box (boundingBox).

    [explicit] PortalQueryParametersForItems::PortalQueryParametersForItems(const QString &query, const Esri::ArcGISRuntime::Envelope &boundingBox)

    Constructor that accepts a query string and a bounding box (boundingBox).

    PortalQueryParametersForItems::PortalQueryParametersForItems(const Esri::ArcGISRuntime::PortalQueryParametersForItems &other)

    Copy constructor from other PortalQueryParametersForItems.

    PortalQueryParametersForItems::PortalQueryParametersForItems(Esri::ArcGISRuntime::PortalQueryParametersForItems &&other)

    Move constructor from other PortalQueryParametersForItems.

    [explicit] PortalQueryParametersForItems::PortalQueryParametersForItems(const Esri::ArcGISRuntime::PortalQueryParameters &other)

    Copy constructor from other PortalQueryParameters.

    [override virtual] PortalQueryParametersForItems::~PortalQueryParametersForItems()

    Destructor.

    [static] Esri::ArcGISRuntime::PortalQueryParametersForItems PortalQueryParametersForItems::forItemType(Esri::ArcGISRuntime::PortalItemType type, const QString &searchString = QString())

    Static function that returns a new PortalQueryParametersForItems with a type and searchString set.

    [static] Esri::ArcGISRuntime::PortalQueryParametersForItems PortalQueryParametersForItems::forItemTypeInGroup(Esri::ArcGISRuntime::PortalItemType type, const QString &groupId, const QString &searchString = QString())

    Static function that returns a new PortalQueryParametersForItems with a type, groupId, and searchString set.

    [static] Esri::ArcGISRuntime::PortalQueryParametersForItems PortalQueryParametersForItems::forItemTypeWithOwner(Esri::ArcGISRuntime::PortalItemType type, const QString &owner, const QString &searchString = QString())

    Static function that returns a new PortalQueryParametersForItems with a type, owner username, and searchString set.

    [static] Esri::ArcGISRuntime::PortalQueryParametersForItems PortalQueryParametersForItems::forItemTypes(const QList<Esri::ArcGISRuntime::PortalItemType> &types, const QString &owner, const QString &groupId, const QString &searchString)

    Static function that returns a new PortalQueryParametersForItems with a list of item types, an owner username, a groupId, and a searchString set.

    QString PortalQueryParametersForItems::groupId() const

    Returns the ID of the PortalGroup for which all items must belong.

    See also setGroupId() and PortalGroup.

    [static] Esri::ArcGISRuntime::PortalQueryParametersForItems PortalQueryParametersForItems::inGroup(const QString &groupId)

    Static function that returns a new PortalQueryParametersForItems with a groupId set.

    QString PortalQueryParametersForItems::itemId() const

    Returns the ID of the specific PortalItem to be retrieved.

    See also setItemId() and PortalItem.

    QString PortalQueryParametersForItems::owner() const

    Returns the username of the PortalUser to whom all the items must belong.

    See also setOwner() and PortalUser.

    QString PortalQueryParametersForItems::searchString() const

    Returns the custom search string to be used for querying.

    See the ArcGIS REST API for more details.

    See also setSearchString().

    void PortalQueryParametersForItems::setGroupId(const QString &groupId)

    Sets the groupId of the PortalGroup for which all items must belong.

    See also groupId() and PortalGroup.

    void PortalQueryParametersForItems::setItemId(const QString &itemId)

    Sets the itemId of the specific PortalItem to be retrieved.

    See also itemId() and PortalItem.

    void PortalQueryParametersForItems::setOwner(const QString &owner)

    Sets the username of the owner to whom all the items must belong.

    See also owner() and PortalUser.

    void PortalQueryParametersForItems::setSearchString(const QString &searchString)

    Sets the custom searchString to be used for querying.

    See the ArcGIS REST API for more details.

    See also searchString().

    void PortalQueryParametersForItems::setTypes(const QList<Esri::ArcGISRuntime::PortalItemType> &types)

    Sets the types of PortalItems to retrieve.

    See also types() and PortalItemType.

    QList<Esri::ArcGISRuntime::PortalItemType> PortalQueryParametersForItems::types() const

    Returns the list of types of PortalItem to retrieve.

    See also setTypes().

    [static] Esri::ArcGISRuntime::PortalQueryParametersForItems PortalQueryParametersForItems::withId(const QString &ItemId)

    Static function that returns a new PortalQueryParametersForItems with an ItemId set.

    [static] Esri::ArcGISRuntime::PortalQueryParametersForItems PortalQueryParametersForItems::withOwner(const QString &owner)

    Static function that returns a new PortalQueryParametersForItems with an owner username set.

    Esri::ArcGISRuntime::PortalQueryParametersForItems &PortalQueryParametersForItems::operator=(const Esri::ArcGISRuntime::PortalQueryParametersForItems &other)

    Assignment operator from other PortalQueryParametersForItems.

    Esri::ArcGISRuntime::PortalQueryParametersForItems &PortalQueryParametersForItems::operator=(Esri::ArcGISRuntime::PortalQueryParametersForItems &&other)

    Move operator from other PortalQueryParametersForItems.

    Esri::ArcGISRuntime::PortalQueryParametersForItems &PortalQueryParametersForItems::operator=(const Esri::ArcGISRuntime::PortalQueryParameters &other)

    Assignment operator from other PortalQueryParameters.

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