public class

PortalItem

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

Class Overview

This class represents an item stored in an ArcGIS portal and contains information about the item such as the item's unique ID, the owning Portal, and the type of item it is (PortalItemType), for example a WebMap, a map service, or a tile package.

A PortalItem can be used to create an instance of the item for item types supported by this API. For example a WebMap can be created from a PortalItem of type WEBMAP via newInstance(PortalItem) and displayed in an Android application. This class contains meta data about the portal item rather than the content of the item itself. The content for a particular item (such as a WebMap) will be retrieved when the item instance is created.

Summary

Public Methods
void clear()
Destroys the objects held internally by this PortalItem.
boolean equals(Object obj)
List<PortalItemComment> fetchComments()
Fetches comments for the item.
InputStream fetchData()
Fetches data for the item.
static PortalItem fetchItem(Portal portal, String itemId)
Retrieves the portal item hosted on the specified portal with the specified item ID.
byte[] fetchThumbnail()
Fetches the thumbnail for this item.
static PortalItem fromJson(JsonParser parser, Portal portal)
Creates a PortalItem from a JSON Parser.
PortalAccess getAccess()
Returns the access level of this item.
float getAvgRating()
Returns the average rating for this item.
long getCreated()
Returns the date on which this item was created.
String getCredits()
Returns the credit information of this item.
String getDescription()
Returns the description for this item.
Envelope getExtent()
Returns the extent for this item.
String getItemId()
Returns the ID for this item.
String getLicenseInfo()
Returns the information about licenses or restrictions to view or edit the item.
long getModified()
Returns 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 number of ratings for this item.
int getNumViews()
Returns the number of times this item has been viewed.
String getOwner()
Returns the username of the owner of this item.
Portal getPortal()
Returns the Portal that contains this item.
String getSnippet()
Returns the snippet description associated with this item.
SpatialReference getSpatialReference()
Returns the SpatialReference of this item.
List<String> getTags()
Returns a list of tags associated with this item.
String getThumbnailFileName()
Returns the filename of the thumbnail for this item.
String getTitle()
Returns the title of this item.
PortalItemType getType()
Returns the type of this item.
List<String> getTypeKeywords()
Returns a list of keywords that further describe the type of this item.
int hashCode()
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void clear ()

Destroys the objects held internally by this PortalItem.

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public List<PortalItemComment> fetchComments ()

Fetches comments for the item. Performs a network request on the current thread, so do not call this from the UI thread.

Returns
List<PortalItemComment> a list of comments for this portal item
Throws
Exception if unable to complete the request

public InputStream fetchData ()

Fetches data for the item. Performs a network request on the current thread, so do not call this from the UI thread. Note that the InputStream should be closed after using it.

Returns
InputStream an InputStream object
Throws
Exception if unable to complete the request

public static PortalItem fetchItem (Portal portal, String itemId)

Retrieves the portal item hosted on the specified portal with the specified item ID. Performs a network request on the current thread, so do not call this from the UI thread.

Parameters
portal Portal: the Portal hosting the desired portal item
itemId String: ID of the item to be retrieved
Returns
PortalItem the portal item
Throws
Exception any exception on retrieving the item, for example if the portal credentials provided were not valid for a secured item, or if the item ID passed in does not exist

public byte[] fetchThumbnail ()

Fetches the thumbnail for this item. Performs a network request on the current thread, so do not call this from the UI thread.

Returns
byte[] byte[] containing the thumbnail data, or null if there is no thumbnail
Throws
Exception if unable to complete the request

public static PortalItem fromJson (JsonParser parser, Portal portal)

Creates a PortalItem from a JSON Parser.

Parameters
parser JsonParser: contains the JSON to parse
portal Portal: the Portal which contains the item
Returns
PortalItem a new PortalItem or null if the JSON is invalid
Throws
Exception if unable to complete the request

public PortalAccess getAccess ()

Returns the access level of this item.

Returns
PortalAccess access level of this item

public float getAvgRating ()

Returns the average rating for this item.

Returns
float average rating for this item

public long getCreated ()

Returns the date on which this item was created.

Returns
long date on which this item was created

public String getCredits ()

Returns the credit information of this item.

Returns
String credit information of this item

public String getDescription ()

Returns the description for this item.

Returns
String description for this item

public Envelope getExtent ()

Returns the extent for this item.

Returns
Envelope extent for this item

public String getItemId ()

Returns the ID for this item. The ID is unique per item.

Returns
String ID for this item

public String getLicenseInfo ()

Returns the information about licenses or restrictions to view or edit the item.

Returns
String license information of this item

public long getModified ()

Returns the date on which this item was last modified.

Returns
long date on which this item was last modified

public String getName ()

Returns the name of this item.

Returns
String name of this item

public int getNumComments ()

Returns the number of comments for this item.

Returns
int number of comments for this item

public int getNumRatings ()

Returns the number of ratings for this item.

Returns
int number of ratings for this item

public int getNumViews ()

Returns the number of times this item has been viewed.

Returns
int number of times this item has been viewed

public String getOwner ()

Returns the username of the owner of this item.

Returns
String username of the owner of this item

public Portal getPortal ()

Returns the Portal that contains this item.

Returns
Portal Portal that contains this item

public String getSnippet ()

Returns the snippet description associated with this item.

Returns
String snippet description associated with this item

public SpatialReference getSpatialReference ()

Returns the SpatialReference of this item.

Returns
SpatialReference SpatialReference of this item

public List<String> getTags ()

Returns a list of tags associated with this item. When creating the item the owner has to specify some tags. Queries can then use the 'tags' field to find item with particular tags.

Returns
List<String> list of tags associated with this item

public String getThumbnailFileName ()

Returns the filename of the thumbnail for this item.

Returns
String filename of the thumbnail for this item

public String getTitle ()

Returns the title of this item.

Returns
String title of this item

public PortalItemType getType ()

Returns the type of this item.

Returns
PortalItemType type of this item

public List<String> getTypeKeywords ()

Returns a list of keywords that further describe the type of this item. Each item is tagged with a set of type keywords that are derived based on its primary type.

Returns
List<String> list of keywords that describe the type of this item

public int hashCode ()

Returns
int

public String toString ()

Returns
String