24   QString endPoint = communityUrl;
 
   25   if ( endPoint.endsWith( 
'/' ) )
 
   29     endPoint += QLatin1String( 
"/self" );
 
   31     endPoint += QStringLiteral( 
"/users/" ) + user;
 
   33   QUrl queryUrl( endPoint );
 
   34   QUrlQuery query( queryUrl );
 
   35   query.addQueryItem( QStringLiteral( 
"f" ), QStringLiteral( 
"json" ) );
 
   36   queryUrl.setQuery( query );
 
   43   const QVariantMap info = 
retrieveUserInfo( communityUrl, user, authcfg, errorTitle, errorText, requestHeaders, feedback );
 
   44   return info.value( QStringLiteral( 
"groups" ) ).toList();
 
   49   QString endPoint = contentUrl;
 
   50   if ( endPoint.endsWith( 
'/' ) )
 
   53   endPoint += QStringLiteral( 
"/groups/" ) + groupId;
 
   60     QUrl queryUrl( endPoint );
 
   61     QUrlQuery query( queryUrl );
 
   62     query.addQueryItem( QStringLiteral( 
"f" ), QStringLiteral( 
"json" ) );
 
   63     query.addQueryItem( QStringLiteral( 
"start" ), QString::number( start ) );
 
   64     query.addQueryItem( QStringLiteral( 
"num" ), QString::number( pageSize ) );
 
   65     queryUrl.setQuery( query );
 
   68     if ( !errorText.isEmpty() )
 
   69       return QVariantList();
 
   71     items.append( response.value( QStringLiteral( 
"items" ) ).toList() );
 
   76     const int total = response.value( QStringLiteral( 
"total" ) ).toInt();
 
   86   const QVariantList items = 
retrieveGroupContent( contentUrl, groupId, authcfg, errorTitle, errorText, requestHeaders, feedback, pageSize );
 
   90   for ( 
const QVariant &item : items )
 
   92     const QVariantMap itemDef = item.toMap();
 
   93     const QString itemType = itemDef.value( QStringLiteral( 
"type" ) ).toString();
 
   95     for ( 
int filterType : itemTypes )
 
   97       if ( typeToString( 
static_cast< ItemType >( filterType ) ).compare( itemType, Qt::CaseInsensitive ) == 0 )
 
  112       return QStringLiteral( 
"Feature Service" );
 
  114       return QStringLiteral( 
"Map Service" );
 
  116       return QStringLiteral( 
"Image Service" );
 
static QVariantMap retrieveUserInfo(const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle, QString &errorText, const QMap< QString, QString > &requestHeaders=QMap< QString, QString >(), QgsFeedback *feedback=nullptr)
Retrieves JSON user info for the specified user name.
static QVariantList retrieveGroupItemsOfType(const QString &contentUrl, const QString &groupId, const QString &authcfg, const QList< int > &itemTypes, QString &errorTitle, QString &errorText, const QMap< QString, QString > &requestHeaders=QMap< QString, QString >(), QgsFeedback *feedback=nullptr, int pageSize=100)
Retrieves JSON definitions for all items which belong the the specified groupId.
static QVariantList retrieveGroupContent(const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle, QString &errorText, const QMap< QString, QString > &requestHeaders=QMap< QString, QString >(), QgsFeedback *feedback=nullptr, int pageSize=100)
Retrieves JSON definitions for all items which belong the the specified groupId.
static QVariantList retrieveUserGroups(const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle, QString &errorText, const QMap< QString, QString > &requestHeaders=QMap< QString, QString >(), QgsFeedback *feedback=nullptr)
Retrieves JSON definitions for all groups which the specified user name is a member of.
ItemType
Portal item types (not complete)
@ MapService
ArcGIS Server map service.
@ FeatureService
ArcGIS Server feature service.
@ ImageService
ArcGIS Server image service.
static QVariantMap queryServiceJSON(const QUrl &url, const QString &authcfg, QString &errorTitle, QString &errorText, const QgsStringMap &requestHeaders=QgsStringMap(), QgsFeedback *feedback=nullptr)
Performs a blocking request to a URL and returns the retrieved JSON content.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
bool isCanceled() const
Tells whether the operation has been canceled already.