com.esri.core.internal.catalog
Class Catalog

java.lang.Object
  extended by com.esri.core.internal.catalog.Catalog

public class Catalog
extends Object

This class is used for connecting to arcgis.com and searching for Items, Users and Groups


Constructor Summary
Catalog(URL url)
          Constructs a Catalog with a URL to arcgis.com or a Mobile content server for which the URL takes the form http:///arcgis/mobile
 
Method Summary
static void getItem(String address, String itemId, String username, String password, CallbackListener<Item> callbackListener)
           
 List<Folder> getMyContents()
          Return contents of the signed in user.
 List<Group> getMyGroups()
          Returns the groups that the signed in user belongs to.
 User getSignedInUser()
          Get information about the signed in user.
protected  URL getUrl()
          Internal method to return the base URL arcgis.com catalog is connected to.
protected  String getUserToken()
          Internal method to obtain the signed in user's token to send requests to the server.
static void getWebMap(Item item, String username, String password, CallbackListener<WebMap> callbackListener)
           
static void getWebMap(String address, String itemId, String username, String password, CallbackListener<WebMap> callbackListener)
           
 List<Folder> getWebMapsFromContentServer()
          Retrieves publicly accessible WebMaps organized within Folders, from an ArcGIS Mobile content server.
 ResultCursor<Item> searchFeaturedMaps(Item.ItemType type)
          Returns Items that are classified as 'Featured Maps'
 ResultCursor<Group> searchGroups(String query, Group.SortField sortField, SortOrder sortOrder)
          Returns Groups that match the search criteria.
 ResultCursor<Item> searchItems(String query, Item.ItemType type, Item.SortField sortField, SortOrder sortOrder)
          Returns Items that match the search criteria.
 ResultCursor<User> searchUsers(String query, User.SortField sortField, SortOrder sortOrder)
          Returns Users that match the search criteria.
 void setDefaultTokenExpirationTime(long millis)
          Changes the default token expiration time for a signed in user.
 void signIn(String uname, String pwd)
          Allows a user to sign into an arcgis.com
 void signInToMCS(String uname, String pwd)
          Allows a user to sign into a mobile content server.
 void signOut()
          Signs the user out of arcgis.com
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Catalog

public Catalog(URL url)
Constructs a Catalog with a URL to arcgis.com or a Mobile content server for which the URL takes the form http:///arcgis/mobile

Parameters:
url - a URL to arcgis.com or a Mobile content server
Method Detail

setDefaultTokenExpirationTime

public void setDefaultTokenExpirationTime(long millis)
                                   throws CatalogException
Changes the default token expiration time for a signed in user. The default token expiration time set by arcgis.com is 60 mins and the maximum token expiration time is 1 year.

Parameters:
millis - time in millis
Throws:
CatalogException - if the specified time in millis exceeds the maximum token expiration time

signInToMCS

public void signInToMCS(String uname,
                        String pwd)
                 throws EsriSecurityException
Allows a user to sign into a mobile content server. May make networking calls.

Parameters:
uname - username
pwd - password
Throws:
EsriSecurityException - if there are problems signing in

signIn

public void signIn(String uname,
                   String pwd)
            throws CatalogException
Allows a user to sign into an arcgis.com

Parameters:
uname - username
pwd - password
Throws:
CatalogException - if there are problems signing in

getMyContents

public List<Folder> getMyContents()
                           throws CatalogException
Return contents of the signed in user. The user must be signed in to access their content. The 0'th folder in the returned list of folders is the root folder and the remaining folders are subfolders under the root folder. arcgis.com does not support multi-level folder structures.

Returns:
a List of Folder objects
Throws:
CatalogException - if the user is not signed in or there are problems obtaining a response from the server

getMyGroups

public List<Group> getMyGroups()
                        throws CatalogException
Returns the groups that the signed in user belongs to.

Returns:
a List of Groups
Throws:
CatalogException - if the user is not signed in or there are problems obtaining a response from the server

signOut

public void signOut()
Signs the user out of arcgis.com


getSignedInUser

public User getSignedInUser()
                     throws CatalogException
Get information about the signed in user.

Returns:
a User object containing information about the signed in user
Throws:
CatalogException - if the user is not signed in or there are problems obtaining a response from the server

searchFeaturedMaps

public ResultCursor<Item> searchFeaturedMaps(Item.ItemType type)
                                      throws CatalogException
Returns Items that are classified as 'Featured Maps'

Parameters:
type - the type of Item
Returns:
a cursor to a collection of Items returned from the server
Throws:
CatalogException - if there are problems obtaining a response from the server

getWebMapsFromContentServer

public List<Folder> getWebMapsFromContentServer()
                                         throws CatalogException
Retrieves publicly accessible WebMaps organized within Folders, from an ArcGIS Mobile content server.

Returns:
a list of Folders
Throws:
CatalogException

searchItems

public ResultCursor<Item> searchItems(String query,
                                      Item.ItemType type,
                                      Item.SortField sortField,
                                      SortOrder sortOrder)
                               throws CatalogException
Returns Items that match the search criteria. The query string could be a simple keyword search string or an advanced search string consisting of field names of an Item.

For example, to search for all items that have the keyword "San Francisco" the value of query would be "San Francisco". On the other hand, to search for all Items that have the title "San Francisco" and are owned by the user 'esri', query would be "title:"San Franscisco" AND owner:esri"

Parameters:
query - the query String
type - the type of Item
sortField - the field that must be used to sort the the search results
sortOrder - the sort order
Returns:
a cursor to a collection of Items returned from the server
Throws:
CatalogException - if there are problems obtaining a response from the server

searchGroups

public ResultCursor<Group> searchGroups(String query,
                                        Group.SortField sortField,
                                        SortOrder sortOrder)
                                 throws CatalogException
Returns Groups that match the search criteria. The query string could be a simple keyword search string or an advanced search string consisting of field names of an Group.

For example, to search for all Groups that have the keyword "Redlands" the value of query would be "Redlands". On the other hand, to search for all Groups that have the title "Redlands" and are owned by the user 'esri', query would be "title:"Redlands" AND owner:esri"

Parameters:
query - the query String
sortField - the field that must be used to sort the the search results
sortOrder - the sort order
Returns:
a cursor to a collection of Groups returned from the server
Throws:
CatalogException - if there are problems obtaining a response from the server

searchUsers

public ResultCursor<User> searchUsers(String query,
                                      User.SortField sortField,
                                      SortOrder sortOrder)
                               throws CatalogException
Returns Users that match the search criteria. To search for Users that contain the text 'John' in their profile, the value of query would be "john"

Parameters:
query - the query String
sortField - the field that must be used to sort the the search results
sortOrder - the sort order
Returns:
a cursor to a collection of Users returned from the server
Throws:
CatalogException - if there are problems obtaining a response from the server

getUserToken

protected String getUserToken()
                       throws CatalogException
Internal method to obtain the signed in user's token to send requests to the server. If the user's token has expired, a new token is automatically fetched before returning it.

Returns:
the signed in user's token.
Throws:
CatalogException - if there are problems in obtaining a new token

getUrl

protected URL getUrl()
Internal method to return the base URL arcgis.com catalog is connected to.

Returns:

getItem

public static void getItem(String address,
                           String itemId,
                           String username,
                           String password,
                           CallbackListener<Item> callbackListener)

getWebMap

public static void getWebMap(String address,
                             String itemId,
                             String username,
                             String password,
                             CallbackListener<WebMap> callbackListener)

getWebMap

public static void getWebMap(Item item,
                             String username,
                             String password,
                             CallbackListener<WebMap> callbackListener)


Copyright © 2012. All Rights Reserved.