public class

PortalQueryParams

extends Object
java.lang.Object
   ↳ com.esri.core.portal.PortalQueryParams

Class Overview

Creates query parameters suitable for finding content contained in a Portal. The query can contain multiple parameters that help to limit the content returned back by the Portal such as sort order, sort field, starting index, etc.

Summary

Nested Classes
enum PortalQueryParams.PortalQuerySortOrder Describes whether the query result order returns in ascending or descending order. 
Public Constructors
PortalQueryParams()
Creates a PortalQueryParams with default settings.
PortalQueryParams(String query)
Creates a PortalQueryParams with default settings.
PortalQueryParams(String query, int limit)
Creates a PortalQueryParams with default settings.
Public Methods
boolean equals(Object obj)
Map<StringString> generateRequestParams(String orgId, boolean isPre162)
Generate request params for restricted search using the org id.
Map<StringString> generateRequestParams()
Generate request params.
int getLimit()
Returns the maximum number of results to be included in the result set response.
String getQuery()
Retruns the query string to search against.
String getSortField()
Returns the field to sort the results by.
PortalQueryParams.PortalQuerySortOrder getSortOrder()
Returns whether the order of results are returned in ascending or descending order.
int getStartIndex()
Returns the number of the first entry in the result set response.
int hashCode()
boolean isCanSearchPublic()
Sets to false for restricted search.
void setCanSearchPublic(boolean canSearchPublic)
Sets to false for restricted search.
PortalQueryParams setLimit(int limit)
Sets the maximum number of results to be included in the result set response.
PortalQueryParams setQuery(PortalItemType type, String groupId, String searchQuery)
Sets a query on the portalQueryParams that will (optionally) find items of a given type that are in a specific group with a specific search string.
PortalQueryParams setQuery(String query)
Sets the query string to search against.
PortalQueryParams setQueryForGroups(String username, String title)
Sets a query on the portalQueryParams that will find groups with a specified owner and title.
PortalQueryParams setQueryForItemWithId(String itemId)
Sets a query on the portalQueryParams that will find an item with a specified itemId.
PortalQueryParams setQueryForItemsInGroup(String groupId)
Sets a query on the portalQueryParams that will find items in a specified group.
PortalQueryParams setSortField(String sortField)
Set the field to sort the results by.
PortalQueryParams setSortOrder(PortalQueryParams.PortalQuerySortOrder sortOrder)
Sets whether the order of results are returned in ascending or descending order.
PortalQueryParams setStartIndex(int startIndex)
Set the number of the first entry in the result set response.
String toString()
PortalQueryParams withNextStart(int nextStart)
Returns a new copy of the PortalQueryParams with the startIndex field being set to the nextStart parameter.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PortalQueryParams ()

Creates a PortalQueryParams with default settings. Start Index will be 1, Limit will be 10, and Sort Order will be descending. The query will be null until one is set.

public PortalQueryParams (String query)

Creates a PortalQueryParams with default settings. This is the same as PortalQueryParams(), with the addition of the query being set.

Parameters
query - this is a string query passed in by the user format such as OWNER:username AND title:mygroupname

public PortalQueryParams (String query, int limit)

Creates a PortalQueryParams with default settings. This is the same as PortalQueryParams(), with the addition of the query and limit being set.

Parameters
query - this is a string query passed in by the user format such as OWNER:username AND title:mygroupname
limit - the limit is 10 if not set by the user

Public Methods

public boolean equals (Object obj)

public Map<StringString> generateRequestParams (String orgId, boolean isPre162)

Generate request params for restricted search using the org id.

Parameters
orgId set null for no restriction.
isPre162 the is pre162
Returns
  • the hash map< string, string>

public Map<StringString> generateRequestParams ()

Generate request params.

Returns
  • the hash map< string, string>

public int getLimit ()

Returns the maximum number of results to be included in the result set response.

Returns
  • The maximum number of results to be included in the result set response

public String getQuery ()

Retruns the query string to search against.

Returns
  • The query string to search against

public String getSortField ()

Returns the field to sort the results by.

Returns
  • The field to sort the results by

public PortalQueryParams.PortalQuerySortOrder getSortOrder ()

Returns whether the order of results are returned in ascending or descending order.

Returns
  • The order of results are returned in ascending or descending order

public int getStartIndex ()

Returns the number of the first entry in the result set response. The index number is 1-based.

Returns
  • The number of the first entry in the result set response. The index number is 1-based

public int hashCode ()

public boolean isCanSearchPublic ()

Sets to false for restricted search.

Returns
  • Returns the canSearchPublic.

public void setCanSearchPublic (boolean canSearchPublic)

Sets to false for restricted search.

Parameters
canSearchPublic The canSearchPublic to set.

public PortalQueryParams setLimit (int limit)

Sets the maximum number of results to be included in the result set response.

Parameters
limit - maximum number of results returned, its preset to 10 until specified otherwise.
Returns
  • this PortalQueryParams

public PortalQueryParams setQuery (PortalItemType type, String groupId, String searchQuery)

Sets a query on the portalQueryParams that will (optionally) find items of a given type that are in a specific group with a specific search string.

Any of the parameters may be null, and the query will only be set for the non-null parameters. If all are set, the query will search for items that match the type AND are in the group AND match the search string. If none are set, a generic search will be performed.

Parameters
type The item type - can be null
groupId The group's ID - can be null
searchQuery The string to search for - can be null
Returns
  • this PortalQueryParams

public PortalQueryParams setQuery (String query)

Sets the query string to search against.

Parameters
query - string for searching the portal for groups, e.g. OWNER:user AND TITLE:username
Returns
  • this PortalQueryParams

public PortalQueryParams setQueryForGroups (String username, String title)

Sets a query on the portalQueryParams that will find groups with a specified owner and title.

Either username or title may be null, and the query will only be set for the non-null parameter. If both are set, the query will search for items that are owned by the username AND that match the specified title.

Parameters
username - username of the group
title - title of the group
Returns
  • this PortalQueryParams

public PortalQueryParams setQueryForItemWithId (String itemId)

Sets a query on the portalQueryParams that will find an item with a specified itemId. Its a convenience method provided in the case where the user already has a portal and groups. Knows the item id and is ready to use it.

Parameters
itemId - item id of the item.
Returns
  • this PortalQueryParams

public PortalQueryParams setQueryForItemsInGroup (String groupId)

Sets a query on the portalQueryParams that will find items in a specified group.

Parameters
groupId - this is the id of the group for which the user needs to find items
Returns
  • this PortalQueryParams

public PortalQueryParams setSortField (String sortField)

Set the field to sort the results by. You can also sort by multiple fields for an item, comma seperated. The currently allowed field names are title, uploaded, type, owner, avgRating, numRatings, numComments and numViews.

Parameters
sortField - the results returned are sorted by the field provided.
Returns
  • this PortalQueryParams

public PortalQueryParams setSortOrder (PortalQueryParams.PortalQuerySortOrder sortOrder)

Sets whether the order of results are returned in ascending or descending order.

Parameters
sortOrder - the results returned are in the order specified.
Returns
  • this PortalQueryParams

public PortalQueryParams setStartIndex (int startIndex)

Set the number of the first entry in the result set response. The index number is 1-based.

Parameters
startIndex the start index
Returns
  • this PortalQueryParams

public String toString ()

public PortalQueryParams withNextStart (int nextStart)

Returns a new copy of the PortalQueryParams with the startIndex field being set to the nextStart parameter.

Parameters
nextStart the next start
Returns
  • A new copy of the PortalQueryParams with the startIndex field being set to the nextStart parameter