Inherits from NSObject
Declared in MDLFolder.h
MDLFolder.m

Overview

MDLFolder represents a folder, as described by Mendeley.

Tasks

Properties

documents

The folder documents.

@property (strong, nonatomic) NSArray *documents

Discussion

The folder documents.

Declared In

MDLFolder.h

identifier

The folder identifier.

@property (copy, nonatomic) NSString *identifier

Discussion

The folder identifier.

Declared In

MDLFolder.h

name

The folder name.

@property (copy, nonatomic) NSString *name

Discussion

The folder name.

Declared In

MDLFolder.h

numberOfDocuments

The folder number of documents.

@property (strong, nonatomic) NSNumber *numberOfDocuments

Discussion

The folder number of documents.

Declared In

MDLFolder.h

parent

The folder parent.

@property (weak, nonatomic) MDLFolder *parent

Discussion

The folder parent.

Declared In

MDLFolder.h

parentIdentifier

The folder parent identifier.

@property (copy, nonatomic) NSString *parentIdentifier

Discussion

The folder parent identifier.

Declared In

MDLFolder.h

subfolders

The folder subfolders.

@property (strong, nonatomic) NSArray *subfolders

Discussion

The folder subfolders.

Declared In

MDLFolder.h

Class Methods

createFolderWithName:parent:success:failure:

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

+ (MDLFolder *)createFolderWithName:(NSString *)name parent:(MDLFolder *)parent success:(void ( ^ ) ( MDLFolder *))success failure:(void ( ^ ) ( NSError *))failure

Parameters

name

The name of the folder.

parent

The parent folder. If parent = nil, the folder is created at the root level.

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 MDLFolder with its newly assigned folder 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 folder, with folder identifier = nil.

Discussion

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

Declared In

MDLFolder.h

fetchFoldersInUserLibrarySuccess:failure:

Sends a folder API request using the shared client.

+ (void)fetchFoldersInUserLibrarySuccess:(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 MDLFolder 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 folder API request using the shared client.

Declared In

MDLFolder.h

Instance Methods

addDocument:success:failure:

Sends a add document to folder API request using the shared client.

- (void)addDocument:(MDLDocument *)document success:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

document

A MDLDocmuent to add to the current folder.

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 add document to folder API request using the shared client.

Declared In

MDLFolder.h

deleteSuccess:failure:

Sends a delete folder API request using the shared client.

- (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 folder API request using the shared client.

Declared In

MDLFolder.h

fetchDocumentsAtPage:count:success:failure:

Sends a folders 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 folders documents API request for the current document using the shared client.

Declared In

MDLFolder.h

removeDocument:success:failure:

Sends a delete document from folder API request using the shared client.

- (void)removeDocument:(MDLDocument *)document success:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

document

The document to remove.

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 document from folder API request using the shared client.

Declared In

MDLFolder.h