Inherits from NSObject
Declared in MDLGroup.h
MDLGroup.m

Overview

MDLGroup represents a group, as described by Mendeley.

Tasks

Properties

admins

The group admins.

@property (strong, nonatomic) NSArray *admins

Discussion

The group admins.

Declared In

MDLGroup.h

category

The group category.

@property (strong, nonatomic) MDLCategory *category

Discussion

The group category.

Declared In

MDLGroup.h

documents

The group documents.

@property (strong, nonatomic) NSArray *documents

Discussion

The group documents.

Declared In

MDLGroup.h

followers

The group followers.

@property (strong, nonatomic) NSArray *followers

Discussion

The group followers.

Declared In

MDLGroup.h

identifier

The group identifier.

@property (copy, nonatomic) NSString *identifier

Discussion

The group identifier.

Declared In

MDLGroup.h

members

The group members.

@property (strong, nonatomic) NSArray *members

Discussion

The group members.

Declared In

MDLGroup.h

mendeleyURL

The group Mendeley URL.

@property (strong, nonatomic) NSURL *mendeleyURL

Discussion

The group Mendeley URL.

Declared In

MDLGroup.h

name

The group name.

@property (copy, nonatomic) NSString *name

Discussion

The group name.

Declared In

MDLGroup.h

numberOfAdmins

The group number of admins.

@property (strong, nonatomic) NSNumber *numberOfAdmins

Discussion

The group number of admins.

Declared In

MDLGroup.h

numberOfDocuments

The group number of documents.

@property (strong, nonatomic) NSNumber *numberOfDocuments

Discussion

The group number of documents.

Declared In

MDLGroup.h

numberOfFollowers

The group number of followers.

@property (strong, nonatomic) NSNumber *numberOfFollowers

Discussion

The group number of followers.

Declared In

MDLGroup.h

numberOfMembers

The group number of members.

@property (strong, nonatomic) NSNumber *numberOfMembers

Discussion

The group number of members.

Declared In

MDLGroup.h

owner

The group owner.

@property (strong, nonatomic) MDLUser *owner

Discussion

The group owner.

Declared In

MDLGroup.h

type

The group type (can be ‘private’, ‘invite’, or ‘open’)

@property (nonatomic, assign) MDLGroupType type

Discussion

The group type (can be ‘private’, ‘invite’, or ‘open’)

Declared In

MDLGroup.h

Class Methods

createGroupWithName:type:success:failure:

Creates a MDLGroup and sends an API creation request using the shared client.

+ (MDLGroup *)createGroupWithName:(NSString *)name type:(MDLGroupType)type success:(void ( ^ ) ( MDLGroup *))success failure:(void ( ^ ) ( NSError *))failure

Parameters

name

The name of the group.

type

The type of the group.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes one argument: the created MDLGroup with its newly assigned group identifier.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Return Value

The newly-initialized group, with group identifier = nil.

Discussion

Creates a MDLGroup and sends an API creation request using the shared client.

Declared In

MDLGroup.h

fetchGroupsInUserLibrarySuccess:failure:

Sends a user library groups API request using the shared client and fetches the response as an array of MDLGroup.

+ (void)fetchGroupsInUserLibrarySuccess:(void ( ^ ) ( NSArray *))success failure:(void ( ^ ) ( NSError *))failure

Parameters

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes one argument: an array of MDLGroup objects.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a user library groups API request using the shared client and fetches the response as an array of MDLGroup.

Declared In

MDLGroup.h

fetchTopGroupsInPublicLibraryForCategory:atPage:count:success:failure:

Sends a public group overview API request using the shared client and fetches the response as an array of MDLGroup.

+ (void)fetchTopGroupsInPublicLibraryForCategory:(NSString *)categoryIdentifier atPage:(NSUInteger)pageIndex count:(NSUInteger)count success:(void ( ^ ) ( NSArray *, NSUInteger , NSUInteger , NSUInteger , NSUInteger ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

categoryIdentifier

The identifier of the category.

pageIndex

The page index. O is first page.

count

The number of items returned per page. Maximum is 1000.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes five arguments: an array of MDLGroup objects, the total number of results, the total number of pages, the index of the current page, and the number of items per page.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a public group overview API request using the shared client and fetches the response as an array of MDLGroup.

Declared In

MDLGroup.h

Instance Methods

deleteSuccess:failure:

Sends a delete group API request using the shared client (you need to be a owner of the group).

- (void)deleteSuccess:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes no argument.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a delete group API request using the shared client (you need to be a owner of the group).

Declared In

MDLGroup.h

fetchDetailsSuccess:failure:

Sends a public groups details API request for the current document using the shared client.

- (void)fetchDetailsSuccess:(void ( ^ ) ( MDLGroup *))success failure:(void ( ^ ) ( NSError *))failure

Parameters

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes one argument: the current group with its newly assigned details.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a public groups details API request for the current document using the shared client.

Declared In

MDLGroup.h

fetchDocumentsAtPage:count:success:failure:

Sends a groups documents API request for the current document using the shared client.

- (void)fetchDocumentsAtPage:(NSUInteger)pageIndex count:(NSUInteger)count success:(void ( ^ ) ( NSArray *, NSUInteger , NSUInteger , NSUInteger , NSUInteger ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

pageIndex

The page index. O is first page.

count

The number of items returned per page.

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes five arguments: an array of MDLDocument objects, the total number of results, the total number of pages, the index of the current page, and the number of items per page.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a groups documents API request for the current document using the shared client.

Declared In

MDLGroup.h

fetchPeopleSuccess:failure:

Sends a groups people API request for the current document using the shared client.

- (void)fetchPeopleSuccess:(void ( ^ ) ( MDLGroup *))success failure:(void ( ^ ) ( NSError *))failure

Parameters

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes one argument: the current group with its newly assigned people.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a groups people API request for the current document using the shared client.

Declared In

MDLGroup.h

leaveSuccess:failure:

Sends a leave group API request using the shared client (you need to be an administrator or a member of the group).

- (void)leaveSuccess:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes no argument.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a leave group API request using the shared client (you need to be an administrator or a member of the group).

Declared In

MDLGroup.h

unfollowSuccess:failure:

Sends a unfollow group API request using the shared client (you need to be a follower of the group).

- (void)unfollowSuccess:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

success

A block object to be executed when the request operation finishes successfully. This block has no return value and takes no argument.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the resonse data. This block has no return value and takes one argument: the NSError object describing the network or parsing error that occurred.

Discussion

Sends a unfollow group API request using the shared client (you need to be a follower of the group).

Declared In

MDLGroup.h