Inherits from NSObject
Declared in MDLDocument.h

Overview

MDLDocument represents a user’s document, as described by Mendeley.

Tasks

Properties

DOI

The document DOI (Digital Object Identifier).

@property (copy, nonatomic) NSString *DOI

Discussion

The document DOI (Digital Object Identifier).

Declared In

MDLDocument.h

abstract

The abstract of the document.

@property (copy, nonatomic) NSString *abstract

Discussion

The abstract of the document.

Declared In

MDLDocument.h

authors

The authors of the document stored as MDLAuthor.

@property (strong, nonatomic) NSArray *authors

Discussion

The authors of the document stored as MDLAuthor.

Declared In

MDLDocument.h

files

The files of the document.

@property (strong, nonatomic) NSArray *files

Discussion

The files of the document.

Declared In

MDLDocument.h

group

The group of the document, if it belongs to one.

@property (strong, nonatomic) MDLGroup *group

Discussion

The group of the document, if it belongs to one.

Declared In

MDLDocument.h

identifier

The document identifier, as generated by Mendeley.

@property (copy, nonatomic) NSString *identifier

Discussion

The document identifier, as generated by Mendeley.

Declared In

MDLDocument.h

isInUserLibrary

A Boolean value that corresponds to whether the document is in the user library.

@property (readonly) BOOL isInUserLibrary

Discussion

A Boolean value that corresponds to whether the document is in the user library.

Declared In

MDLDocument.h

mendeleyURL

The Mendeley URL of the document.

@property (strong, nonatomic) NSURL *mendeleyURL

Discussion

The Mendeley URL of the document.

Declared In

MDLDocument.h

publication

The publication of the document.

@property (strong, nonatomic) MDLPublication *publication

Discussion

The publication of the document.

Declared In

MDLDocument.h

title

The title of the document.

@property (copy, nonatomic) NSString *title

Discussion

The title of the document.

Declared In

MDLDocument.h

type

The type of the document. This is @"Generic" by default.

@property (copy, nonatomic) NSString *type

Discussion

The type of the document. This is @"Generic" by default.

Declared In

MDLDocument.h

year

The year of the document.

@property (strong, nonatomic) NSNumber *year

Discussion

The year of the document.

Declared In

MDLDocument.h

Class Methods

createDocumentWithTitle:parameters:success:failure:

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

+ (MDLDocument *)createDocumentWithTitle:(NSString *)title parameters:(NSDictionary *)parameters success:(void ( ^ ) ( MDLDocument *))success failure:(void ( ^ ) ( NSError *))failure

Parameters

title

The title of the document.

parameters

Optional parameters of the document.

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

Discussion

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

Declared In

MDLDocument.h

fetchAuthoredDocumentsInUserLibraryAtPage:count:success:failure:

Sends a user authored API request using the shared client.

+ (void)fetchAuthoredDocumentsInUserLibraryAtPage:(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 user authored API request using the shared client.

Declared In

MDLDocument.h

fetchDocumentsInUserLibraryAtPage:count:success:failure:

Sends a user library API request using the shared client.

+ (void)fetchDocumentsInUserLibraryAtPage:(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 user library API request using the shared client.

Declared In

MDLDocument.h

fetchTopDocumentsInPublicLibraryForCategory:upAndComing:success:failure:

Sends a top documents (papers) API request using the shared client and fetches the response as an array of MDLDocument.

+ (void)fetchTopDocumentsInPublicLibraryForCategory:(NSString *)categoryIdentifier upAndComing:(BOOL)upAndComing success:(void ( ^ ) ( NSArray *))success failure:(void ( ^ ) ( NSError *))failure

Parameters

categoryIdentifier

If not nil, the identifier of the category, otherwise across all categories.

upAndComing

If true, results apply to ‘trending’ documents.

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 MDLDocument 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 top documents (papers) API request using the shared client and fetches the response as an array of MDLDocument.

Declared In

MDLDocument.h

searchAuthoredWithName:year:atPage:count:success:failure:

Sends a search authored API request using the shared client.

+ (void)searchAuthoredWithName:(NSString *)name year:(NSNumber *)year atPage:(NSUInteger)pageIndex count:(NSUInteger)count success:(void ( ^ ) ( NSArray *, NSUInteger , NSUInteger , NSUInteger , NSUInteger ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

name

The name of the author for the search query

year

The year for the search query

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 for the match, 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 search authored API request using the shared client.

Declared In

MDLDocument.h

searchTagged:category:subcategory:atPage:count:success:failure:

Sends a search tagged API request using the shared client.

+ (void)searchTagged:(NSString *)tag category:(MDLCategory *)category subcategory:(MDLSubcategory *)subcategory atPage:(NSUInteger)pageIndex count:(NSUInteger)count success:(void ( ^ ) ( NSArray *, NSUInteger , NSUInteger , NSUInteger , NSUInteger ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

tag

The tags for the search query

category

The category for the search query

subcategory

The subcategory for the search query

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 for the match, 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 search tagged API request using the shared client.

Declared In

MDLDocument.h

searchWithGenericTerms:authors:title:year:tags:atPage:count:success:failure:

Sends an API search request with specific terms using the shared client.

+ (void)searchWithGenericTerms:(NSString *)genericTerms authors:(NSString *)authors title:(NSString *)title year:(NSNumber *)year tags:(NSString *)tags atPage:(NSUInteger)pageIndex count:(NSUInteger)count success:(void ( ^ ) ( NSArray *, NSUInteger , NSUInteger , NSUInteger , NSUInteger ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

genericTerms

The terms for the search query

authors

The authors for the search query

title

The title for the search query

year

The year for the search query

tags

The tags for the search query

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 for the match, 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 an API search request with specific terms using the shared client.

Declared In

MDLDocument.h

searchWithTerms:atPage:count:success:failure:

Sends an API search request with generic terms using the shared client.

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

Parameters

terms

The terms for the search query

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 for the match, 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 an API search request with generic terms using the shared client.

Declared In

MDLDocument.h

Instance Methods

deleteSuccess:failure:

Sends a delete document 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 one argument: an array of MDLDocument 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 delete document API request using the shared client.

Declared In

MDLDocument.h

fetchDetailsSuccess:failure:

Sends an API details request for the current document using the shared client.

- (void)fetchDetailsSuccess:(void ( ^ ) ( MDLDocument *))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 document 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 an API details request for the current document using the shared client.

Declared In

MDLDocument.h

fetchRelatedDocumentsAtPage:count:success:failure:

Sends a related documents API request using the shared client.

- (void)fetchRelatedDocumentsAtPage:(NSUInteger)pageIndex count:(NSUInteger)count success:(void ( ^ ) ( NSArray *))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 one argument: an array of MDLDocument 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 related documents API request using the shared client.

Declared In

MDLDocument.h

uploadFileAtURL:success:failure:

Sends an API upload request using the shared client.

- (void)uploadFileAtURL:(NSURL *)fileURL success:(void ( ^ ) ( ))success failure:(void ( ^ ) ( NSError *))failure

Parameters

fileURL

The local URL for the file to upload.

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 an API upload request using the shared client.

Keep in mind that Mendeley only handles a limited number of file formats (.pdf, etc).

Declared In

MDLDocument.h