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.newInstance(PortalItem, CallbackListener).


Method Summary
 void clear()
          Destroys the thumbnail and other objects internally held by this PortalItem.
 boolean equals(Object obj)
          
 void fetchComments(PortalListener<List<PortalItemComment>> portalListener)
          Kicks off an operation that fetches comments for the item.
static void fetchItem(Portal portal, String itemId, PortalListener<PortalItem> portalListener)
          Returns a portal item using a portal and item id.
 void fetchThumbnail(PortalListener<byte[]> portalListener)
          Kicks off an operation that fetches the thumbnail.
static PortalItem fromJson(org.codehaus.jackson.JsonParser parser, Portal portal)
           
 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.
 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.
 byte[] getThumbnail()
          Returns the thumbnail of 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()
          
 void setPortal(Portal portal)
          Sets the portal that contains this item.
 void setTitle(String title)
          Sets the title of this item.
 void setType(PortalItemType type)
          Sets the type of this item.
 String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

fetchItem

public static void fetchItem(Portal portal,
                             String itemId,
                             PortalListener<PortalItem> portalListener)
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

fetchComments

public void fetchComments(PortalListener<List<PortalItemComment>> portalListener)
Kicks off an operation that fetches comments for the item.

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

fetchThumbnail

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

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

fromJson

public static PortalItem fromJson(org.codehaus.jackson.JsonParser parser,
                                  Portal portal)
                           throws Exception
Throws:
Exception

getPortal

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

Returns:
The portal that contains this item

setPortal

public void setPortal(Portal portal)
Sets the portal that contains this item.

Parameters:
portal -

getItemId

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

Returns:
The id for this item

getOwner

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

Returns:
The owner of this item

getCreated

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

Returns:
The date on which this item was created

getModified

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

Returns:
The date on which this item was last modified

getTitle

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

Returns:
The title of this item

setTitle

public void setTitle(String title)
Sets the title of this item.

Parameters:
title -

getType

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

Returns:
The PortalItemType of this item

setType

public void setType(PortalItemType type)
Sets the type of this item.

Parameters:
type -

getDescription

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

Returns:
A description for this item

getTags

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

Returns:
A list of tags associated with this item

getSnippet

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

Returns:
A snippet description associated with this item

getThumbnailFileName

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

Returns:
The filename of the thumbnail of this items

getThumbnail

public byte[] getThumbnail()
Returns the thumbnail of this item.

Returns:
The thumbnail of this item

getExtent

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

Returns:
The extent for this item

getSpatialReference

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

Returns:
The SpatialReference of this item

getCredits

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

Returns:
The credit information of this item

getLicenseInfo

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

Returns:
The license information of this item

getNumComments

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

Returns:
The number of comments for this item

getNumRatings

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

Returns:
The number of ratings for this item

getAvgRating

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

Returns:
The average rating for this item

getNumViews

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

Returns:
The number of times this item has been viewed

getAccess

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

Returns:
The access level of this item

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.



Copyright © 2012. All Rights Reserved.