com.esri.core.internal.catalog
Class Item

java.lang.Object
  extended by com.esri.core.internal.catalog.Item
All Implemented Interfaces:
PageableResultType

public class Item
extends Object
implements PageableResultType

This class represents an Item stored in arcgis.com. The Item is the URI returned by all search operations. The Item class only contains information about an item stored in the server.


Nested Class Summary
static class Item.ItemType
          Represents the type of an Item stored in arcgis.com. arcgis.com allows users to store a myriad of Items types classified by the medium in which the Items are stored on the server (File, Text or URL) and the ArcGIS applications that an Item type is applicable for.
static class Item.SortField
          The fields of an Item stored as a back-end database table on the server, that can be used to sort search results
 
Constructor Summary
  Item()
          Constructs an empty Item.
protected Item(URL url)
          Constructs an empty Item with a URL to the Item stored in arcgis.com.
 
Method Summary
 void clear()
          Destroys the thumbnail and license information internally held by this Item
<T extends PageableResultType>
int
compare(T arg0)
          Internal method that all instances of a PageableResultType must implement.
 boolean fromJson(org.codehaus.jackson.JsonParser parser, com.esri.core.internal.catalog.Filter filter, Catalog catalog)
          Sets the internal state of the Item with values contained in the Json response.
 String getAccess()
          Returns the access settings on this Item
 float getAvgRating()
          Returns the average ratings for this Item
 String getDescription()
          Returns a description for this Item
 String getDocumentation()
          Returns the documentation for this Item
 Envelope getExtent()
          Returns the extent for this Item
 String getGuid()
          Returns the Guid for this Item
 String getId()
          Returns the id for this Item.
 List<String> getKeywords()
          Returns a list of keywords associated with this Item
 String getLicenseInfoHtml()
          Returns the license information as HTML string
 String getMCSAddress()
           
 Date getModifiedDate()
          Return the date on which this Item was last modified
 String getName()
          Returns the name of this Item
 int getNumComments()
          Returns the number of comments for this Item
 int getNumRatings()
          Returns the ratings for this Item
 int getNumViews()
          Returns the number of time this Item has been viewed
 User getOwner()
          Returns the owner of this Item
 String getOwnerName()
          Returns the name of this Item's owner.
 int getSize()
          Returns the size of this Item
 String getSnippet()
          Returns a snippet description associated with this Item
 SpatialReference getSpRef()
          Returns the SpatialReference of this Item
 List<String> getTags()
          Returns a list of tags associated with this Item
 byte[] getThumbnail()
          Returns a thumbnail for this item.
 byte[] getThumbnailIfExists()
          Returns a thumbnail if it was previously fetched from the server and is cached in the Item.
 String getTitle()
          Returns the title of this Item
 Item.ItemType getType()
          Returns the type of this Item
 Date getUploaded()
          Returns the date on which this Item was uploaded
 URL getUrl()
          Returns the URL of this Item.
 void setMCSAddress(String mcsAddress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Item

protected Item(URL url)
Constructs an empty Item with a URL to the Item stored in arcgis.com. The internal state of the Item is set by invoking the fromJson(JsonParser, Filter, Catalog) method.

Parameters:
url - a URL to an Item stored on arcgis.com

Item

public Item()
Constructs an empty Item. The internal state of the Item is set by invoking the fromJson(JsonParser, Filter, Catalog) method.

Method Detail

fromJson

public boolean fromJson(org.codehaus.jackson.JsonParser parser,
                        com.esri.core.internal.catalog.Filter filter,
                        Catalog catalog)
                 throws Exception
Sets the internal state of the Item with values contained in the Json response.

Specified by:
fromJson in interface PageableResultType
Parameters:
parser - the Json response
filter - a client side filter
catalog - a reference to the Catalog
Returns:
true if this Item qualifies to be returned to the client after the filter has been applied, else false
Throws:
Exception

getId

public String getId()
Returns the id for this Item. The id is unique per Item.

Returns:
the id

getOwner

public User getOwner()
              throws CatalogException
Returns the owner of this Item

Returns:
the owner
Throws:
CatalogException

getOwnerName

public String getOwnerName()
Returns the name of this Item's owner.

Returns:
the name of the owner

getUploaded

public Date getUploaded()
Returns the date on which this Item was uploaded

Returns:
the uploaded Date

getModifiedDate

public Date getModifiedDate()
Return the date on which this Item was last modified

Returns:
the last modified Date

getGuid

public String getGuid()
Returns the Guid for this Item

Returns:
the guid

getName

public String getName()
Returns the name of this Item

Returns:
the name

getUrl

public URL getUrl()
Returns the URL of this Item. It is the responsibility of the application invoking this method to infer the type of service (Dynamic Map Service layer, Tiled Map Service layer, etc) the URL represents.

Returns:
the URL of a GIS Service layer

getTitle

public String getTitle()
Returns the title of this Item

Returns:
the title

getKeywords

public List<String> getKeywords()
Returns a list of keywords associated with this Item

Returns:
a list of keywords

getDescription

public String getDescription()
Returns a description for this Item

Returns:
the description

getTags

public List<String> getTags()
Returns a list of tags associated with this Item

Returns:
a list of tags

getSnippet

public String getSnippet()
Returns a snippet description associated with this Item

Returns:
the snippet

getThumbnail

public byte[] getThumbnail()
Returns a thumbnail for this item. The consuming application (Android/Java SE) can use platform specific APIs to construct an image out of the bytes returned.

Returns:
an array of the image bytes

getThumbnailIfExists

public byte[] getThumbnailIfExists()
Returns a thumbnail if it was previously fetched from the server and is cached in the Item. If a thumbanail has not yet been fetched, then this method returns immediately without fetching the thumbnail from the server. This method primarily exists for applications that want to quickly test for the existence of the thumbnail, possibly on a UI thread, and fetch the thumbnail from the server on a separate worker thread if necessary.

Returns:
null if the thumbnail is not cached in the Item else returns an array of image bytes

clear

public void clear()
Destroys the thumbnail and license information internally held by this Item


getDocumentation

public String getDocumentation()
Returns the documentation for this Item

Returns:
the documentation

getExtent

public Envelope getExtent()
Returns the extent for this Item

Returns:
the Envelope

getSpRef

public SpatialReference getSpRef()
Returns the SpatialReference of this Item

Returns:
the SpatialReference

getLicenseInfoHtml

public String getLicenseInfoHtml()
Returns the license information as HTML string

Returns:
the licenseInfoHtml

getAccess

public String getAccess()
Returns the access settings on this Item

Returns:
the access

getNumComments

public int getNumComments()
Returns the number of comments for this Item

Returns:
the numComments

getNumRatings

public int getNumRatings()
Returns the ratings for this Item

Returns:
the numRatings

getSize

public int getSize()
Returns the size of this Item

Returns:
the size

getAvgRating

public float getAvgRating()
Returns the average ratings for this Item

Returns:
the avgRating

getNumViews

public int getNumViews()
Returns the number of time this Item has been viewed

Returns:
the numViews

getType

public Item.ItemType getType()
Returns the type of this Item

Returns:
the #Item.ItemType

compare

public <T extends PageableResultType> int compare(T arg0)
Description copied from interface: PageableResultType
Internal method that all instances of a PageableResultType must implement.

Specified by:
compare in interface PageableResultType
Parameters:
arg0 - an instance of a PageableResultType
Returns:
-1 if this instance is less than arg0, 1 if it is greater, 0 if they are equal.

getMCSAddress

public String getMCSAddress()

setMCSAddress

public void setMCSAddress(String mcsAddress)


Copyright © 2012. All Rights Reserved.