AGSPortalQueryParams Class Reference


Description

To query a portal for items or groups, AGSPortal's findItemsWithQueryParams: and findItemsWithQueryParams: need to be used with the query parameters obtained from AGSPortalQueryParams. It provides various pre-defined query strings. You can also create custom query strings as per the specification in the Portal API. It also helps you to search with paging enabled by specifying the search limit and start index. You can also sort the results according to a particular field in the results.

Since:
2.2
Inheritance diagram for AGSPortalQueryParams:
<AGSCoding>

List of all members.

Public Member Functions

(void) - decodeWithJSON:
(NSDictionary *) - encodeToJSON
(id) - initWithJSON:
(id) - initWithQuery:
(id) - initWithQuery:limit:

Static Public Member Functions

(AGSPortalQueryParams *) + queryParamsForGroupsWithOwner:title:
(AGSPortalQueryParams *) + queryParamsForItemsInGroup:
(AGSPortalQueryParams *) + queryParamsForItemsOfType:inGroup:
(AGSPortalQueryParams *) + queryParamsForItemsOfType:inGroup:withSearchString:
(AGSPortalQueryParams *) + queryParamsForItemsOfType:withSearchString:
(AGSPortalQueryParams *) + queryParamsForItemWithId:
(AGSPortalQueryParams *) + queryParamsWithQuery:
(AGSPortalQueryParams *) + queryParamsWithQuery:limit:

Properties

int limit
NSString * query
NSString * sortField
AGSPortalQuerySortOrder sortOrder
int startIndex

Member Function Documentation

- (void) decodeWithJSON: (NSDictionary *)  json   [optional, inherited]

Decode object from JSON representation.

Parameters:
json The JSON representation of the object to be decoded.
Since:
1.0
- (NSDictionary *) encodeToJSON   [optional, inherited]

Encode and return JSON representation for object.

Returns:
JSON representation of object.
Since:
1.0
- (id) initWithJSON: (NSDictionary *)  json   [optional, inherited]

Initialize and return object from JSON representation.

Parameters:
json The JSON representation of the object to be created.
Returns:
Object decoded from JSON representation.
Since:
1.0

Reimplemented in AGSWebMapFeatureCollection.

- (id) initWithQuery: (NSString *)  query  

Initializes a AGSPortalQueryParams with a query string.

Parameters:
query The query string.
Since:
2.2
- (id) initWithQuery: (NSString *)  query
limit: (int)  limit 

Initializes a AGSPortalQueryParams with a query string and the limit on results.

Parameters:
query The query string.
limit The number of results to be returned.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsForGroupsWithOwner: (NSString *)  username
title: (NSString *)  title 

Returns query params that will find groups with a specified owner and title. Either property can be nil, but not simultaneously.

Parameters:
username The username of the owner.
title The title of the group.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsForItemsInGroup: (NSString *)  groupId  

Returns query params that will find all items belonging to a specified group.

Parameters:
groupId The id of the group.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsForItemsOfType: (AGSPortalItemType type
inGroup: (NSString *)  groupId 

Returns query params that will find items with a specified type that belong to a specified group.

Parameters:
type The type of the portal item.
groupId The id of the group. Can be nil.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsForItemsOfType: (AGSPortalItemType type
inGroup: (NSString *)  groupId
withSearchString: (NSString *)  searchString 

Returns query params that will find items with a specified type that belong to a specified group .

Parameters:
type The type of the portal item.
groupId The id of the group. Can be nil.
searchString The string used for broader search on the items; such as on tags, title etc. Can be nil.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsForItemsOfType: (AGSPortalItemType type
withSearchString: (NSString *)  searchString 

Returns query params that will find items with a specified type that satisfy the specified criteria.

Parameters:
type The type of the portal item.
searchString The string used for broader search on the items; such as on tags, title etc. Can be nil.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsForItemWithId: (NSString *)  itemId  

Returns a query params that will find an item with a specified id.

Parameters:
itemId The id of the item.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsWithQuery: (NSString *)  query  

A method to get an initialized, autoreleased query params object with a query string.

Parameters:
query The query string.
Since:
2.2
+ (AGSPortalQueryParams*) queryParamsWithQuery: (NSString *)  query
limit: (int)  limit 

A method to get an initialized, autoreleased query params object with a query string and the limit.

Parameters:
query The query string.
limit The number of results to be returned.
Since:
2.2

Property Documentation

- (int) limit [read, write, assign]

The number of results to be returned. This, along with the startIndex, can help you paginate the search results. .

Since:
2.2
- (NSString*) query [read, write, retain]

The query string specified for the search.

Since:
2.2
- (NSString*) sortField [read, write, retain]

The field on which sorting should be done.

Since:
2.2
- (AGSPortalQuerySortOrder) sortOrder [read, write, assign]

The order of sorting.

Since:
2.2
- (int) startIndex [read, write, assign]

The index from which the results should be returned. The index number is 1-based. You should use this for paginating the search results.

Since:
2.2