Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
 All Classes Functions Variables Properties Pages
Instance Methods | Properties | List of all members
INQueryParameter Class Reference

Simplified use of Indivo's Query API. More...

#import <INQueryParameter.h>

Inherits NSObject.

Instance Methods

(void) - addFilter:withValue:
 Adds a filter. More...
 
(void) - addParameter:withValue:
 Adds a custom parameter. More...
 
(id) - initWithQueryString:
 Initializes the receiver with information found in the query string. More...
 
(NSArray *) - queryParameters
 The query parameters currently defined in the receiver. More...
 
(void) - removeFilterForKey:
 Removes a filter, if it exists. More...
 
(void) - removeParameterForKey:
 Unsets a custom parameter. More...
 
(void) - setFromQueryString:
 Sets the receivers properties from the supplied query string. More...
 
(BOOL) - updateFromParameter:withValue:
 Sets the internal state represented by the given parameter string, according to the key. More...
 

Properties

NSString * aggregateBy
 The field by which to aggregate. More...
 
INAggregationOperator aggregateOperator
 The operator to apply to the "aggregateBy" field. More...
 
NSString * dateGroupField
 The field which to group according to "dateGroupIncrement". More...
 
INDateGroup dateGroupIncrement
 The increment for date grouping. More...
 
NSDate * dateRangeEnd
 End date of the date range in field "dateRangeField". More...
 
NSString * dateRangeField
 The field upon which to limit the date range. More...
 
NSDate * dateRangeStart
 Starting date of the date range in field "dateRangeField". More...
 
BOOL descending
 NO by default, if YES the ordering is reversed. More...
 
NSDictionary * filters
 The filters to be applied, not URL-escaped (this will be done for you) More...
 
NSString * groupBy
 Group by values of this field. If "orderBy" is not nil it will be reset to this value. More...
 
NSUInteger limit
 How many items to get, 0 by default which will return the server's default. More...
 
NSUInteger offset
 The offset where to start, 0 by default. More...
 
NSString * orderBy
 The field by which to order. More...
 
INDocumentStatus status
 The status of the documents, INDocumentStatusUnknown by default. More...
 

Detailed Description

Simplified use of Indivo's Query API.

Method Documentation

- (void) addFilter: (NSString *)  filterKey
withValue: (NSString *)  filterValue 

Adds a filter.

- (void) addParameter: (NSString *)  aParameter
withValue: (NSString *)  paramValue 

Adds a custom parameter.

If it matches one of the supported types, that one is used instead.

- (id) initWithQueryString: (NSString *)  aQuery

Initializes the receiver with information found in the query string.

- (NSArray *) queryParameters

The query parameters currently defined in the receiver.

Returns
An array full of NSString in the form "key=value", not yet URL-escaped.
- (void) removeFilterForKey: (NSString *)  filterKey

Removes a filter, if it exists.

- (void) removeParameterForKey: (NSString *)  aKey

Unsets a custom parameter.

If it matches a supported type, that one is unset instead (NOT YET IMPLEMENTED)

Todo:
unset built-in parameter
- (void) setFromQueryString: (NSString *)  aQuery

Sets the receivers properties from the supplied query string.

Attention
Existing values will only be altered if they are present in the query string, unaffected values will not be reset to default.
Filters cannot be automatically parsed.
Parameters
aQueryA query string, e.g. "offset=20&limit=20", from which to parse the properties
- (BOOL) updateFromParameter: (NSString *)  aParameter
withValue: (NSString *)  paramValue 

Sets the internal state represented by the given parameter string, according to the key.

Returns
YES if the parameter is handled internally, NO otherwise

Property Documentation

- (NSString*) aggregateBy
readwritenonatomiccopy

The field by which to aggregate.

- (INAggregationOperator) aggregateOperator
readwritenonatomicassign

The operator to apply to the "aggregateBy" field.

- (NSString*) dateGroupField
readwritenonatomiccopy

The field which to group according to "dateGroupIncrement".

- (INDateGroup) dateGroupIncrement
readwritenonatomicassign

The increment for date grouping.

- (NSDate*) dateRangeEnd
readwritenonatomicstrong

End date of the date range in field "dateRangeField".

- (NSString*) dateRangeField
readwritenonatomiccopy

The field upon which to limit the date range.

- (NSDate*) dateRangeStart
readwritenonatomicstrong

Starting date of the date range in field "dateRangeField".

- (BOOL) descending
readwritenonatomicassign

NO by default, if YES the ordering is reversed.

- (NSDictionary*) filters
readwritenonatomiccopy

The filters to be applied, not URL-escaped (this will be done for you)

- (NSString*) groupBy
readwritenonatomiccopy

Group by values of this field. If "orderBy" is not nil it will be reset to this value.

- (NSUInteger) limit
readwritenonatomicassign

How many items to get, 0 by default which will return the server's default.

- (NSUInteger) offset
readwritenonatomicassign

The offset where to start, 0 by default.

- (NSString*) orderBy
readwritenonatomiccopy

The field by which to order.

- (INDocumentStatus) status
readwritenonatomicassign

The status of the documents, INDocumentStatusUnknown by default.


The documentation for this class was generated from the following files: