NetmeraService Class Reference
| Inherits from | NSObject |
| Declared in | NetmeraService.h NetmeraService.m |
Overview
NetmeraService is used to get NetmeraContent object by its search and get methods. Many query options defined to help finding exact object.
Tasks
-
objectNameName of the content
property -
queriesList to add queries for the search
property -
conditionalMapList to add queries for the search
property -
searchTextText to search
property -
searchTypethe search type
property -
locationSearchFieldthe field that holds location info
property -
maxMaximum number of the content to return
property -
pageNumber of the pages
property -
pathPath of the content
property -
sortByName of the field that is used for sorting
property -
sortOrderEnum type of order to use while sorting
property -
– initWithName:Default constructor for the NetmeraService that sets objectName and other default parameters.
-
– count:Gets the total number of results that matches the query.
-
– countInBackgroundWithTarget:selector:Gets the total number of results that match the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over count method.
-
– countInBackgroundWithBlock:Gets the total number of results that match the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over count method.
-
– addSearchText:Adds the searchText into the query.
-
– whereOwnerEqual:This is used to get the contents of the logged user.
-
– whereEqualWithKey:andValue:Adds an options to the query where value that matches with the query is equal to the given value.
-
– whereGreatherThanWithKey:andValue:Adds an options to the query where value that matches with the query is greater than the given value.
-
– whereLessThanWithKey:andValue:Adds an options to the query where value that matches with the query is less than the given value.
-
– whereNotEqualWithKey:andValue:Adds an options to the query where value that matches with the query is not equal to the given value.
-
– whereGreatherThanOrEqualWithKey:andValue:Adds an options to the query where value that matches with the query is greater than or equal to the given value.
-
– whereLessThanOrEqualWithKey:andValue:Adds an options to the query where value that matches with the query is less than or equal to the given value.
-
– whereExistsWithKey:andValue:Adds an options to the query where the given key is exists or not. If value is true then it checks whether key exists, if value is false then it checks whether key not exists.
-
– whereMatchesWithKey:andRegex:Adds an options to the query where value that returns from the query matches with the given regex.
-
– whereStartsWithWithKey:andPrefix:Adds an options to the query where value that matches with the query starts with the given prefix.
-
– whereEndsWithWithKey:andSuffix:Adds an options to the query where value that matches with the query ends with the given suffix.
-
– whereContainedInWithKey:andValues:Adds an options to the query where value that matches with the query contains any of the values in the given collection.
-
– whereAllContaintedInWithKey:andValues:Adds an options to the query where value that matches with the query contains all of the values in the given collection.
-
– circleSearchWithStartLocation:andDistance:andlocationSearchField:withError:Searches the content by taking given location as a base and retrieves the contents that located given distance far away.
-
– circleSearchInBackgroundWithTarget:selector:startLocation:distance:locationSearchField:Searches the content by taking given location as a base and retrieves the contents that located given distance far away in the background thread.Since it runs on the background thread it does not block program.It is recommended over circleSearch method.
-
– boxSearchWithFirstLocation:andSecondLocation:andlocationSearchField:withError:Creates box using the given two location (latitude,longitude) data and searches inside that box.
-
– boxSearchInBackgroundWithTarget:selector:firstLocation:secondLocation:locationSearchField:Creates box using the given two location (latitude,longitude) data and searches inside that box in the background thread.Since it runs on the background thread it does not block program.It is recommended over boxSearch method.
-
– search:Gets the list of NetmeraContent from the network.
-
– searchInBackgroundWithTarget:selector:Retrieves the list of NetmeraContent objects that matches with the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over search method.
-
– searchInBackgroundWithBlock:Retrieves the list of NetmeraContent objects that matches with the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over search method.
-
– get:Gets the single NetmeraContent object that matches the query.
-
– getInBackgroundWithTarget:selector:Gets the single NetmeraContent object that matches the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over get method.
-
– getInBackgroundWithBlock:Gets the single NetmeraContent object that matches the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over get method.
-
– getCustomConditionGets the queries list of queries and merges them as single query.
-
– searchUser:Retrieves the list of NetmeraUser objects that matches with the query.
Properties
conditionalMap
List to add queries for the search
@property (nonatomic, strong) NSMutableDictionary *conditionalMapDiscussion
List to add queries for the search
Declared In
NetmeraService.hlocationSearchField
the field that holds location info
@property (nonatomic, strong) NSString *locationSearchFieldDiscussion
the field that holds location info
Declared In
NetmeraService.hmax
Maximum number of the content to return
@property (nonatomic, setter=setMax:) int maxDiscussion
Maximum number of the content to return
Declared In
NetmeraService.hobjectName
Name of the content
@property (nonatomic, strong) NSString *objectNameDiscussion
Name of the content
Declared In
NetmeraService.hpage
Number of the pages
@property (nonatomic, setter=setPage:) int pageDiscussion
Number of the pages
Declared In
NetmeraService.hpath
Path of the content
@property (nonatomic, strong) NSString *pathDiscussion
Path of the content
Declared In
NetmeraService.hqueries
List to add queries for the search
@property (nonatomic, strong) NSMutableArray *queriesDiscussion
List to add queries for the search
Declared In
NetmeraService.hsearchText
Text to search
@property (nonatomic, strong) NSString *searchTextDiscussion
Text to search
Declared In
NetmeraService.hsearchType
the search type
@property (nonatomic, strong) NSString *searchTypeDiscussion
the search type
Declared In
NetmeraService.hsortBy
Name of the field that is used for sorting
@property (nonatomic, strong) NSString *sortByDiscussion
Name of the field that is used for sorting
Declared In
NetmeraService.hsortOrder
Enum type of order to use while sorting
@property (nonatomic) enum SortOrder sortOrderDiscussion
Enum type of order to use while sorting
Warning: Available enum options for sort order
ascending, sorts contents by increasing order
descending, sorts contents by decreasing order
Declared In
NetmeraService.hInstance Methods
addSearchText:
Adds the searchText into the query.
- (void)addSearchText:(NSString *)searchTextParameters
- searchText
Text to search
Discussion
Adds the searchText into the query.
Declared In
NetmeraService.hboxSearchInBackgroundWithTarget:selector:firstLocation:secondLocation:locationSearchField:
Creates box using the given two location (latitude,longitude) data and searches inside that box in the background thread.Since it runs on the background thread it does not block program.It is recommended over boxSearch method.
- (void)boxSearchInBackgroundWithTarget:(id)target selector:(SEL)selector firstLocation:(NetmeraGeoLocation *)firstPoint secondLocation:(NetmeraGeoLocation *)secondPoint locationSearchField:(NSString *)locationSearchFieldParameters
- target
The target on which the selector will be called.
- selector
The selector to call. It should have the following signature: (void) callBackBoxSearchWithContentArray:(NSArray)netmeraContentArray error:(NSError )error. error will be nil on success and set if there was an error. netmeraContentArray(NSArray with NetmeraContent) is the result of search query.
- firstPoint
NetmeraGeoLocation object
- secondPoint
NetmeraGeoLocation object
- locationSearchField
name of the field that holds location data.
Discussion
Creates box using the given two location (latitude,longitude) data and searches inside that box in the background thread.Since it runs on the background thread it does not block program.It is recommended over boxSearch method.
Declared In
NetmeraService.hboxSearchWithFirstLocation:andSecondLocation:andlocationSearchField:withError:
Creates box using the given two location (latitude,longitude) data and searches inside that box.
- (NSArray *)boxSearchWithFirstLocation:(NetmeraGeoLocation *)firstPoint andSecondLocation:(NetmeraGeoLocation *)secondPoint andlocationSearchField:(NSString *)locationSearchField withError:(NSError **)errorParameters
- firstPoint
NetmeraGeoLocation object
- secondPoint
NetmeraGeoLocation object
- locationSearchField
name of the field that holds location data.
- error
if it cannot access server
Return Value
the list of NetmeraContent object.
Discussion
Creates box using the given two location (latitude,longitude) data and searches inside that box.
Declared In
NetmeraService.hcircleSearchInBackgroundWithTarget:selector:startLocation:distance:locationSearchField:
Searches the content by taking given location as a base and retrieves the contents that located given distance far away in the background thread.Since it runs on the background thread it does not block program.It is recommended over circleSearch method.
- (void)circleSearchInBackgroundWithTarget:(id)target selector:(SEL)selector startLocation:(NetmeraGeoLocation *)startLocation distance:(double)distance locationSearchField:(NSString *)locationSearchFieldParameters
- target
The target on which the selector will be called.
- selector
The selector to call. It should have the following signature: callBackCircleSearchWithContentArray:(NSArray)netmeraContentArray error:(NSError )error. error will be nil on success and set if there was an error. netmeraContentArray(NSArray with NetmeraContent) is the result of search query.
- startLocation
base location to search near it.
- distance
is used to create circle by taking the startLocation as a center.
- locationSearchField
name of the field that holds location data.
Discussion
Searches the content by taking given location as a base and retrieves the contents that located given distance far away in the background thread.Since it runs on the background thread it does not block program.It is recommended over circleSearch method.
Declared In
NetmeraService.hcircleSearchWithStartLocation:andDistance:andlocationSearchField:withError:
Searches the content by taking given location as a base and retrieves the contents that located given distance far away.
- (NSArray *)circleSearchWithStartLocation:(NetmeraGeoLocation *)startLocation andDistance:(double)distance andlocationSearchField:(NSString *)locationSearchField withError:(NSError **)errorParameters
- startLocation
base location to search near it.
- distance
is used to create circle by taking the startLocation as a center.
- locationSearchField
name of the field that holds location data.
- error
if it cannot access server
Return Value
the list of NetmeraContent object.
Discussion
Searches the content by taking given location as a base and retrieves the contents that located given distance far away.
Declared In
NetmeraService.hcount:
Gets the total number of results that matches the query.
- (long)count:(NSError **)errorParameters
- error
if it cannot access server.
Return Value
Returns the total number of results
Discussion
Gets the total number of results that matches the query.
Declared In
NetmeraService.hcountInBackgroundWithBlock:
Gets the total number of results that match the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over count method.
- (void)countInBackgroundWithBlock:(void ( ^ ) ( NSNumber *count , NSError *error ))blockParameters
- block
The block to execute. The block should have the following argument signature: (NSNumber count, NSError error)
Discussion
Gets the total number of results that match the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over count method.
Declared In
NetmeraService.hcountInBackgroundWithTarget:selector:
Gets the total number of results that match the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over count method.
- (void)countInBackgroundWithTarget:(id)target selector:(SEL)selectorParameters
- target
The target on which the selector will be called.
- selector
The selector to call. It should have the following signature: (void)callBackCountWithCount:(NSNumber)count error:(NSError )error. error will be nil on success and set if there was an error. count will tell count of contents
Discussion
Gets the total number of results that match the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over count method.
Declared In
NetmeraService.hget:
Gets the single NetmeraContent object that matches the query.
- (NetmeraContent *)get:(NSError **)errorParameters
- error
if it cannot access server
Discussion
Gets the single NetmeraContent object that matches the query.
Declared In
NetmeraService.hgetInBackgroundWithBlock:
Gets the single NetmeraContent object that matches the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over get method.
- (void)getInBackgroundWithBlock:(void ( ^ ) ( NetmeraContent *content , NSError *error ))blockParameters
- block
The block to execute. The block should have the following argument signature: (NetmeraContent content, NSError error)
Discussion
Gets the single NetmeraContent object that matches the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over get method.
Declared In
NetmeraService.hgetInBackgroundWithTarget:selector:
Gets the single NetmeraContent object that matches the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over get method.
- (void)getInBackgroundWithTarget:(id)target selector:(SEL)selectorParameters
- target
The target on which the selector will be called.
- selector
The selector to call. It should have the following signature: (void)callBackGetWithContent:(NetmeraContent )content error:(NSError )error. error will be nil on success and set if there was an error. content will ne the NetmeraContent object.
Discussion
Gets the single NetmeraContent object that matches the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over get method.
Declared In
NetmeraService.hinitWithName:
Default constructor for the NetmeraService that sets objectName and other default parameters.
- (id)initWithName:(NSString *)objectNameParameters
- objectName
Name of the content
Discussion
Default constructor for the NetmeraService that sets objectName and other default parameters.
Declared In
NetmeraService.hsearch:
Gets the list of NetmeraContent from the network.
- (NSArray *)search:(NSError **)errorParameters
- error
if it cannot access server
Discussion
Gets the list of NetmeraContent from the network.
Declared In
NetmeraService.hsearchInBackgroundWithBlock:
Retrieves the list of NetmeraContent objects that matches with the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over search method.
- (void)searchInBackgroundWithBlock:(void ( ^ ) ( NSArray *netmeraContentArray , NSError *error ))blockParameters
- block
The block to execute. The block should have the following argument signature: (NSArray netmeraContentArray, NSError error)
Discussion
Retrieves the list of NetmeraContent objects that matches with the query in the background thread and executes.Since it runs on the background thread it does not block program.It is recommended over search method.
Declared In
NetmeraService.hsearchInBackgroundWithTarget:selector:
Retrieves the list of NetmeraContent objects that matches with the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over search method.
- (void)searchInBackgroundWithTarget:(id)target selector:(SEL)selectorParameters
- target
The target on which the selector will be called.
- selector
The selector to call. It should have the following signature: (void) callBackSearchWithContentArray:(NSArray)netmeraContentArray error:(NSError )error. error will be nil on success and set if there was an error. netmeraContentArray(NSArray with NetmeraContent) is the result of search query.
Discussion
Retrieves the list of NetmeraContent objects that matches with the query in the background thread.Since it runs on the background thread it does not block program.It is recommended over search method.
Declared In
NetmeraService.hsearchUser:
Retrieves the list of NetmeraUser objects that matches with the query.
- (NSArray *)searchUser:(NSError **)errorParameters
- error
if it cannot access server
Return Value
List of the NetmeraUser array
Discussion
Retrieves the list of NetmeraUser objects that matches with the query.
Declared In
NetmeraService.hwhereAllContaintedInWithKey:andValues:
Adds an options to the query where value that matches with the query contains all of the values in the given collection.
- (void)whereAllContaintedInWithKey:(NSString *)key andValues:(NSArray *)valuesParameters
- key
key to identify specified value
- values
values associates with the specified key
Discussion
Adds an options to the query where value that matches with the query contains all of the values in the given collection.
Declared In
NetmeraService.hwhereContainedInWithKey:andValues:
Adds an options to the query where value that matches with the query contains any of the values in the given collection.
- (void)whereContainedInWithKey:(NSString *)key andValues:(NSArray *)valuesParameters
- key
key to identify specified value
- values
values associates with the specified key
Discussion
Adds an options to the query where value that matches with the query contains any of the values in the given collection.
Declared In
NetmeraService.hwhereEndsWithWithKey:andSuffix:
Adds an options to the query where value that matches with the query ends with the given suffix.
- (void)whereEndsWithWithKey:(NSString *)key andSuffix:(id)suffixParameters
- key
key to identify specified value
- suffix
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query ends with the given suffix.
Declared In
NetmeraService.hwhereEqualWithKey:andValue:
Adds an options to the query where value that matches with the query is equal to the given value.
- (void)whereEqualWithKey:(NSString *)key andValue:(id)valueParameters
- key
key to identify specified value
- value
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query is equal to the given value.
Declared In
NetmeraService.hwhereExistsWithKey:andValue:
Adds an options to the query where the given key is exists or not. If value is true then it checks whether key exists, if value is false then it checks whether key not exists.
- (void)whereExistsWithKey:(NSString *)key andValue:(BOOL)valueParameters
- key
key to identify specified value
- value
BOOL value to check whether key exists or not
Discussion
Adds an options to the query where the given key is exists or not. If value is true then it checks whether key exists, if value is false then it checks whether key not exists.
Declared In
NetmeraService.hwhereGreatherThanOrEqualWithKey:andValue:
Adds an options to the query where value that matches with the query is greater than or equal to the given value.
- (void)whereGreatherThanOrEqualWithKey:(NSString *)key andValue:(id)valueParameters
- key
key to identify specified value
- value
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query is greater than or equal to the given value.
Declared In
NetmeraService.hwhereGreatherThanWithKey:andValue:
Adds an options to the query where value that matches with the query is greater than the given value.
- (void)whereGreatherThanWithKey:(NSString *)key andValue:(id)valueParameters
- key
key to identify specified value
- value
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query is greater than the given value.
Declared In
NetmeraService.hwhereLessThanOrEqualWithKey:andValue:
Adds an options to the query where value that matches with the query is less than or equal to the given value.
- (void)whereLessThanOrEqualWithKey:(NSString *)key andValue:(id)valueParameters
- key
key to identify specified value
- value
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query is less than or equal to the given value.
Declared In
NetmeraService.hwhereLessThanWithKey:andValue:
Adds an options to the query where value that matches with the query is less than the given value.
- (void)whereLessThanWithKey:(NSString *)key andValue:(id)valueParameters
- key
key to identify specified value
- value
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query is less than the given value.
Declared In
NetmeraService.hwhereMatchesWithKey:andRegex:
Adds an options to the query where value that returns from the query matches with the given regex.
- (void)whereMatchesWithKey:(NSString *)key andRegex:(NSString *)regexParameters
- key
key to identify specified value
- regex
value associates with the specified key
Discussion
Adds an options to the query where value that returns from the query matches with the given regex.
Declared In
NetmeraService.hwhereNotEqualWithKey:andValue:
Adds an options to the query where value that matches with the query is not equal to the given value.
- (void)whereNotEqualWithKey:(NSString *)key andValue:(id)valueParameters
- key
key to identify specified value
- value
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query is not equal to the given value.
Declared In
NetmeraService.hwhereOwnerEqual:
This is used to get the contents of the logged user.
- (void)whereOwnerEqual:(NetmeraUser *)userParameters
- user
current user
Discussion
This is used to get the contents of the logged user.
Declared In
NetmeraService.hwhereStartsWithWithKey:andPrefix:
Adds an options to the query where value that matches with the query starts with the given prefix.
- (void)whereStartsWithWithKey:(NSString *)key andPrefix:(id)prefixParameters
- key
key to identify specified value
- prefix
value associates with the specified key
Discussion
Adds an options to the query where value that matches with the query starts with the given prefix.
Declared In
NetmeraService.h