dojo.require("esri.arcgis.PortalItem")
Description
(Added at v2.8)
An item (a unit of content) in the Portal. Each item has a unique identifier and a well known url that is independent of the user owning the item. An item may have associated binary or textual data which is available via the item data resource. View the ArcGIS Portal API REST documentation for the
item for more details.
Samples
Search for
samples that use this class.
Properties
Methods
Property Details
Indicates the level of access: private, shared, org, or public.
Information on the source of the item.
Average rating. Uses a weighted average called "Bayesian average".
The date the item was created.
The item locale information (language and country).
The detailed description of the item.
The bounding rectangle of the item. It is returned as an extent object with the following format:
"extent": [ [
minX,
minY
],
[
maxX,
maxY
]
]
The unique id for this item.
The url to the data resource associated with the item.
Any license information or restrictions.
Date the item was last modified.
Number of comments on the item.
Number of ratings on the item.
Number of views on the item.
The username of the user who owns this item.
The portal that contains the item.
A summary description of the item.
The item's coordinate system.
User defined tags that describe the item.
The url to the thumbnail used for the item.
The title for the item. This is the name that is displayed to users and by which they refer to the item. Every item must have a title.
The gis content type of this item. Example types include : "Web Map" and "Web Mapping Application".
A set of keywords that further describes the type of this item. Each item is tagged with a set of type keywords that are derived based on its primary type.
The url for the resource represented by the item.
The url to the user item.
Method Details
Add a comment to the item. Only available for authenticated users who have access to the item. Returns a deferred that when resolved provides access to a
PortalComment object.
Parameters:
<String > comment |
Required |
The text for the comment. |
Sample:
portalItem.addComment('This is a really cool application.');
Add a rating to an item that you have access to. Only 1 rating can be given to an item per user. If this call is made on an already rated item, the new rating will overwrite the current one. A user cannot rate their own item. Available only to authenticated users. Returns a deferred that when resolved provides access to a
PortalRating object.
Parameters:
<Number > rating |
Required |
Rating to set for the item. Rating must be a number between 1.0 and 5.0. |
Deletes an item comment. Only available to the authenticated user who created the comment.
Delete a rating that you created for the specified item. Returns a deferred that when resolved provides access to a
PortalRating object.
Get the comments associated with the item. Returns a deferred that when resolved provides access to an array of
PortalComment objects.
Sample:
portalItem.getComments().forEach(function(result){
console.log(result.comment);
});
Returns the rating (if any) given to the item. Returns a deferred that when resolved provides access to a
PortalRating object.
Get the URL to the thumbnail image for the portal item.
Available width sizes: 200, 400, 800 and 2400. (Added at v3.21)
Parameters:
<Number > width |
Optional |
The desired image width. |
Updates an item comment. Only available to the authenticated user who created the comment.
Parameters:
<PortalComment > comment |
Required |
A PortalComment that contains the comment updates. |