ArcGIS Runtime SDK for iOS: AGSPortalGroup Class Reference
ArcGIS Runtime SDK for iOS  100.11
AGSPortalGroup Class Reference

Description

Represents a group within the Portal or Organization.

An Instance of this class resource represents a group within the Portal or Organization. The owner is automatically an administrator and is returned in the list of admins. Adminstrators can invite, add to or remove members from a group as well as update or delete the group. The administrator for an organization may also reassign the group to another member of the organization. Group members may leave the group. Authenticated users may apply to join a group.

Since
100
Inheritance diagram for AGSPortalGroup:
AGSLoadableBase <AGSJSONSerializable> AGSObject <AGSLoadable>

Instance Methods

(void) - cancelLoad
 
(void) - doCancelLoading
 
(void) - doStartLoading:
 
(id< AGSCancelable >) - fetchUsersWithCompletion:
 
(id< AGSCancelable >) - findItemsWithSearchParameters:completion:
 
(instancetype) - initWithPortal:groupID:
 
(void) - loadDidFinishWithError:
 
(void) - loadWithCompletion:
 
(void) - onLoadStatusChanged
 
(void) - retryLoadWithCompletion:
 
(nullable id) - toJSON:
 

Class Methods

(nullable id< AGSJSONSerializable >) + fromJSON:error:
 
(nullable AGSPortalGroup *) + fromJSON:withPortal:error:
 
(instancetype) + portalGroupWithPortal:groupID:
 

Properties

AGSPortalAccess access
 
NSArray< NSString * > * admins
 
NSDate * created
 
NSString * groupDescription
 
NSString * groupID
 
BOOL invitationOnly
 
NSError * loadError
 
AGSLoadStatus loadStatus
 
NSDate * modified
 
NSString * owner
 
NSString * phone
 
AGSPortalportal
 
NSString * snippet
 
AGSPortalGroupSortField sortField
 
AGSPortalQuerySortOrder sortOrder
 
NSArray< NSString * > * tags
 
AGSLoadableImagethumbnail
 
NSString * title
 
NSDictionary< NSString *, id > * unknownJSON
 
NSDictionary< NSString *, id > * unsupportedJSON
 
NSArray< NSString * > * users
 
BOOL viewOnly
 

Method Documentation

◆ cancelLoad

- (void) cancelLoad
requiredinherited

Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion: or retryLoadWithCompletion: to complete and this will call them all back with the error of NSUserCancelledError

Since
100

◆ doCancelLoading

- (void) doCancelLoading

Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) at the end passing in an error representing NSUserCancelledError.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ doStartLoading:

- (void) doStartLoading: (BOOL)  retrying

Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p) or retryLoadWithCompletion: (AGSLoadable-p) is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly)) upon completion, passing in the error if any.

Parameters
retryingflag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p).
Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ fetchUsersWithCompletion:

- (id<AGSCancelable>) fetchUsersWithCompletion: (nullable void(^)(NSArray< NSString * > *__nullable users, NSArray< NSString * > *__nullable admins, NSError *__nullable error))  completion

Kicks off an operation to fetch users and admins of the group. The completion block is invoked when the operation completes successfully or if an error is encountered. When completed, the admins and users properties will be populated.

Parameters
completionblock that is invoked when operation finishes
Returns
operation which can be canceled
Since
100

◆ findItemsWithSearchParameters:completion:

- (id<AGSCancelable>) findItemsWithSearchParameters: (AGSPortalGroupContentSearchParameters *)  parameters
completion: (void(^)(AGSPortalGroupContentSearchResultSet *__nullable result, NSError *__nullable error))  completion 

Finds portal items that belong to this group and match the given search parameters This method uses a Group Content Search operation that's designed specifically for finding items that belong to a group. It differs from the findItemsWithQueryParameters:completion: (AGSPortal) method which uses a general-purpose Search operation that's suitable for searching all items stored on a portal.

The behavior of this method differs from the findItemsWithQueryParameters:completion: (AGSPortal) method in the following ways:

It's not necessary to load the AGSPortalGroup before calling this method.

Parameters
parametersthe search parameters
completionBlock that is invoked when the operation finishes. The #result parameter is populated if the operation completed successfully, otherwise the #error parameter is populated.
Returns
An operation which can be canceled.
Since
100.7

◆ fromJSON:error:

+ (nullable id<AGSJSONSerializable>) fromJSON: (id)  JSONObject
error: (NSError **)  error 
staticrequiredinherited

Initializes and returns an object from its JSON representation.

Parameters
JSONObjectNSDictionary or NSArray containing the JSON.
errorencountered during the operation, if any.
Since
100

◆ fromJSON:withPortal:error:

+ (nullable AGSPortalGroup *) fromJSON: (id)  JSONObject
withPortal: (AGSPortal *)  portal
error: (NSError **)  error 

Initialize a portal group with JSON content to represent an existing group in the portal.

Parameters
JSONObjectrepresenting the JSON content of the group
portalThe portal to which the group belongs to.
Since
100

◆ initWithPortal:groupID:

- (instancetype) initWithPortal: (AGSPortal *)  portal
groupID: (NSString *)  groupID 

Creates a portal group object for a specified portal and a specified group ID.

Parameters
portalThe portal to which the group belongs to.
groupIDThe ID of the existing group in the portal.
Since
100.7

◆ loadDidFinishWithError:

- (void) loadDidFinishWithError: (nullable NSError *)  error

Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly)) and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly)) when done loading or failed to load.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ loadWithCompletion:

- (void) loadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Loads data for the object asynchronously. The completion block is invoked upon completion.

You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100
See also
- cancelLoad to cancel loading
- retryLoadWithCompletion: to force reload

◆ onLoadStatusChanged

- (void) onLoadStatusChanged

Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus changes is called. Subclasses can optionally implement this to know when their loading status has changed.

Since
100

Provided by category AGSLoadableBase(ForSubclassEyesOnly).

◆ portalGroupWithPortal:groupID:

+ (instancetype) portalGroupWithPortal: (AGSPortal *)  portal
groupID: (NSString *)  groupID 

Creates a portal group object for a specified portal and a specified group ID.

Parameters
portalThe portal to which the group belongs to.
groupIDThe ID of the existing group in the portal.
Since
100.7

◆ retryLoadWithCompletion:

- (void) retryLoadWithCompletion: (nullable void(^)(NSError *__nullable error))  completion
requiredinherited

Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:

  1. you didn't have network connectivity earlier when it failed and you want to retry now that you have connectivity
  2. the server was down earlier when it failed and you want to retry
  3. the request is taking too long and you want to cancel it and retry, in which case you will first call cancelLoad and then this method

If the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.

Parameters
completionblock that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load.
Note
The completion block is always invoked on the main thread.
Since
100

◆ toJSON:

- (nullable id) toJSON: (NSError **)  error
requiredinherited

Returns JSON representation for this object.

Parameters
errorencountered during the operation, if any.
Returns
NSDictionary or NSArray containing the JSON.
Since
100

Reimplemented in AGSPortalItem.

Property Documentation

◆ access

- (AGSPortalAccess) access
readnonatomicassign

Determines who can access the group's conent. Can be either AGSPortalAccessPrivate, AGSPortalAccessOrganization, or AGSPortalAccessPublic.

AGSPortalAccessPrivate implies only members of the group have access. AGSPortalAccessOrganization implies all members of the organization have access regardless of whether they are members of the group. AGSPortalAccessPublic implies everyone has access.

Since
100

◆ admins

- (NSArray<NSString*>*) admins
readnonatomiccopy

Array of strings representing admin users of the group. These need to be fetched explicitly using fetchUsersWithCompletion:

Since
100

◆ created

- (NSDate*) created
readnonatomicstrong

The date on which the group was created.

Since
100

◆ groupDescription

- (NSString*) groupDescription
readnonatomiccopy

The description of the group, if exists.

Since
100

◆ groupID

- (NSString*) groupID
readnonatomiccopy

Id of the group.

Since
100

◆ invitationOnly

- (BOOL) invitationOnly
readnonatomicassign

If YES, this group will not accept join requests. Else, this group does not require an invitation to join. Only group owners and admins can invite users to the group.

Since
100

◆ loadError

- (NSError*) loadError
readnonatomicstronginherited

The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.

Since
100

◆ loadStatus

- (AGSLoadStatus) loadStatus
readrequirednonatomicassigninherited

Status of the load operation.

Since
100

◆ modified

- (NSDate*) modified
readnonatomicstrong

The date on which the group was modified.

Since
100

◆ owner

- (NSString*) owner
readnonatomiccopy

The user who created the group.

Since
100

◆ phone

- (NSString*) phone
readnonatomiccopy

The contact information for the group.

Since
100

◆ portal

- (AGSPortal*) portal
readnonatomicweak

The portal that the group belongs to. Needs to be optional because it's a weak reference.

Since
100

◆ snippet

- (NSString*) snippet
readnonatomiccopy

Snippet or summary of the group with a character limit of 250 characters.

Since
100

◆ sortField

- (AGSPortalGroupSortField) sortField
readnonatomicassign

Determines the sort field for the group's content. Can be either AGSPortalGroupSortFieldTitle, AGSPortalGroupSortFieldOwner, AGSPortalGroupSortFieldAvgRating, AGSPortalGroupSortFieldNumViews, AGSPortalGroupSortFieldCreated, or AGSPortalGroupSortFieldModified.

Since
100

◆ sortOrder

- (AGSPortalQuerySortOrder) sortOrder
readnonatomicassign

Determines the sort order for the group's content. Can be either AGSPortalQuerySortOrderAscending or AGSPortalQuerySortOrderDescending.

Since
100

◆ tags

- (NSArray<NSString*>*) tags
readnonatomiccopy

Words or short phrases that describe the group.

Since
100

◆ thumbnail

- (AGSLoadableImage*) thumbnail
readnonatomicstrong

The thumbnail image of the group.

If it is nil, there is no group thumbnail. Otherwise, the image needs to be loaded asynchronously by calling loadWithCompletion: (AGSLoadable-p)

Since
100

◆ title

- (NSString*) title
readnonatomiccopy

The group title.

Since
100

◆ unknownJSON

- (NSDictionary<NSString*,id>*) unknownJSON
readrequirednonatomiccopyinherited

A dictionary of values that was in the source JSON but was unparsed by API.

Returns
NSDictionary containing the unknown JSON.
Since
100

◆ unsupportedJSON

- (NSDictionary<NSString*,id>*) unsupportedJSON
readnonatomiccopyinherited

A dictionary of values that are supported by the REST API, but not exposed through the SDK API.

Returns
NSDictionary containing the unsupported JSON.
Since
100

◆ users

- (NSArray<NSString*>*) users
readnonatomiccopy

Array of strings representing users of the group. These need to be fetched explicitly using fetchUsersWithCompletion:

Since
100

◆ viewOnly

- (BOOL) viewOnly
readnonatomicassign

Determines whether the group is 'view only' or not. Users cannot share items with 'view only' groups.

Since
100