com.esri.core.portal
Class PortalItem

java.lang.Object
  extended by com.esri.core.portal.PortalItem

public class PortalItem
extends Object

This class represents an Item stored in a Portal. The Item is the URI returned by all search operations. The Item class only contains information about an item stored in the portal. The actual data (WebMap, FeatureCollection, etc) will be retrieved when creating a WebMap.

Since:
1.0

Method Summary
 void clear()
          Destroys the thumbnail and other objects internally held by this PortalItem.
 boolean equals(Object obj)
          
 List<PortalItemComment> fetchComments()
          Kicks off an operation that fetches comments for the item.
 void fetchComments(PortalListener<List<PortalItemComment>> portalListener)
          Deprecated. please use fetchComments() instead.
 InputStream fetchData()
          Kicks off an operation that fetches data for the item.
static PortalItem fetchItem(Portal portal, String itemId)
          Returns a portal item using a portal and item id.
static void fetchItem(Portal portal, String itemId, PortalListener<PortalItem> portalListener)
          Deprecated. please use fetchItem(Portal, String) instead.
 byte[] fetchThumbnail()
          Kicks off an operation that fetches the thumbnail.
 void fetchThumbnail(PortalListener<byte[]> portalListener)
          Kicks off an operation that fetches the thumbnail.
static PortalItem fromJson(org.codehaus.jackson.JsonParser parser, Portal portal)
          Creates a PortalItem from json string.
 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 a 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 owner of this item.
 Portal getPortal()
          Returns the portal that contains this item.
 String getSnippet()
          Returns a 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 of this item.
 String getTitle()
          Returns the title of this item.
 PortalItemType getType()
          Returns the type of this item.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

fetchItem

@Deprecated
public static void fetchItem(Portal portal,
                                        String itemId,
                                        PortalListener<PortalItem> portalListener)
Deprecated. please use fetchItem(Portal, String) instead.

Returns a portal item using a portal and item id.

Parameters:
portal - - portal for which items should be fetched
itemId - - item id for which item information is required
portalListener - - fetches the portal item
Since:
1.0

fetchItem

public static PortalItem fetchItem(Portal portal,
                                   String itemId)
                            throws Exception
Returns a portal item using a portal and item id.

Parameters:
portal - - portal for which items should be fetched
itemId - - item id for which item information is required
Returns:
the portal item
Throws:
Exception - the exception
Since:
1.0

fetchData

public InputStream fetchData()
                      throws Exception
Kicks off an operation that fetches data for the item. The InputStream should be closed properly after using.

Returns:
an InputStream object.
Throws:
Exception - the exception object
Since:
10.1.1

fetchComments

@Deprecated
public void fetchComments(PortalListener<List<PortalItemComment>> portalListener)
Deprecated. please use fetchComments() instead.

Kicks off an operation that fetches comments for the item.

Parameters:
portalListener - - fetches the portal comment for the item.
Since:
1.0

fetchComments

public List<PortalItemComment> fetchComments()
                                      throws Exception
Kicks off an operation that fetches comments for the item.

Returns:
the list< portal item comment>
Throws:
Exception - if unable to complete the request.
Since:
1.0

fetchThumbnail

public void fetchThumbnail(PortalListener<byte[]> portalListener)
Kicks off an operation that fetches the thumbnail.

Parameters:
portalListener - fetches the thumbnail in its own thread.
Since:
1.0

fetchThumbnail

public byte[] fetchThumbnail()
                      throws Exception
Kicks off an operation that fetches the thumbnail.

Returns:
the byte[]
Throws:
Exception - if unable to complete the request.
Since:
1.0

fromJson

public static PortalItem fromJson(org.codehaus.jackson.JsonParser parser,
                                  Portal portal)
                           throws Exception
Creates a PortalItem from json string.

Parameters:
parser - the json to parse
portal - the portal which contains the item.
Returns:
an new PortalItem or null if the json is invalid.
Throws:
Exception - if unable to complete the request.
Since:
1.0

getPortal

public Portal getPortal()
Returns the portal that contains this item.

Returns:
The portal that contains this item
Since:
1.0

getItemId

public String getItemId()
Returns the id for this item. The id is unique per item.

Returns:
The id for this item
Since:
1.0

getOwner

public String getOwner()
Returns the owner of this item.

Returns:
The owner of this item
Since:
1.0

getCreated

public long getCreated()
Returns the date on which this item was created.

Returns:
The date on which this item was created
Since:
1.0

getModified

public long getModified()
Returns the date on which this item was last modified.

Returns:
The date on which this item was last modified
Since:
1.0

getName

public String getName()
Returns the name of this item.

Returns:
The name of this item
Since:
1.0

getTitle

public String getTitle()
Returns the title of this item.

Returns:
The title of this item
Since:
1.0

getType

public PortalItemType getType()
Returns the type of this item.

Returns:
The PortalItemType of this item
Since:
1.0

getDescription

public String getDescription()
Returns a description for this item.

Returns:
A description for this item
Since:
1.0

getTags

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

Returns:
A list of tags associated with this item
Since:
1.0

getSnippet

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

Returns:
A snippet description associated with this item
Since:
1.0

getThumbnailFileName

public String getThumbnailFileName()
Returns the filename of the thumbnail of this item.

Returns:
The filename of the thumbnail of this items
Since:
1.0

getExtent

public Envelope getExtent()
Returns the extent for this item.

Returns:
The extent for this item
Since:
1.0

getSpatialReference

public SpatialReference getSpatialReference()
Returns the SpatialReference of this item.

Returns:
The SpatialReference of this item
Since:
1.0

getCredits

public String getCredits()
Returns the credit information of this item.

Returns:
The credit information of this item
Since:
1.0

getLicenseInfo

public String getLicenseInfo()
Returns the information about licenses or restrictions to view or edit the item.

Returns:
The license information of this item
Since:
1.0

getNumComments

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

Returns:
The number of comments for this item
Since:
1.0

getNumRatings

public int getNumRatings()
Returns the number of ratings for this item.

Returns:
The number of ratings for this item
Since:
1.0

getAvgRating

public float getAvgRating()
Returns the average rating for this item.

Returns:
The average rating for this item
Since:
1.0

getNumViews

public int getNumViews()
Returns the number of times this item has been viewed.

Returns:
The number of times this item has been viewed
Since:
1.0

getAccess

public PortalAccess getAccess()
Returns the access level of this item.

Returns:
The access level of this item
Since:
1.0

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object

clear

public void clear()
Destroys the thumbnail and other objects internally held by this PortalItem.

Since:
1.0


Copyright © 2012. All Rights Reserved.