PortalItem

class PortalItem : Item, JsonSerializable, Loadable

An object that represents a portal item.

See also

Constructors

Link copied to clipboard
fun PortalItem(portal: Portal, type: PortalItemType)

Creates a new portal item object with the specified type for a specified portal. This constructor is used if you wish to create a new item that you will add to a portal.

Link copied to clipboard
fun PortalItem(portal: Portal, itemId: String)

Creates a portal item object for a specified portal and a specified item ID. Use this constructor to instantiate a PortalItem from an existing item using its unique ID.

Link copied to clipboard
fun PortalItem(url: String)

Creates a portal item object. Use this object to create a portal item from a URL. The supported URL formats are:

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun addComment(comment: String): Result<Unit>

Adds a comment to the portal item. It is available only to authenticated users who have access to the item.

Link copied to clipboard
suspend fun addRating(rating: Float): Result<Unit>

Adds a rating to the item that the current PortalUser has access to.

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
suspend fun fetchComments(): Result<List<PortalItemComment>>

Makes a network request to fetch the comments for this portal item. The result is a list of PortalItemComments for this portal item.

Link copied to clipboard
suspend fun fetchData(): Result<ByteArray>

Fetches the item's data.

Link copied to clipboard
suspend fun fetchGroups(): Result<PortalItemGroups>

Fetches the groups this portal item belongs to. Only those groups that are visible to the current portal user will be returned.

Link copied to clipboard
suspend fun fetchRelatedItems(relationship: PortalItemRelationship, direction: PortalItemRelationshipDirection): Result<List<PortalItem>>

Fetches all related portal items with the specified relationship to this portal item.

suspend fun fetchRelatedItems(relationships: Iterable<PortalItemRelationship>, direction: PortalItemRelationshipDirection): Result<List<PortalItem>>

Fetches all related portal items with any of the specified relationships to this portal item.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.

Link copied to clipboard
fun setThumbnail(image: BitmapDrawable?)

Sets the thumbnail of the item with the specified image.

Link copied to clipboard
suspend fun shareWith(everyone: Boolean, organization: Boolean = false): Result<Unit>

Shares the item based on the given parameters.

Link copied to clipboard
suspend fun shareWithGroups(groups: Iterable<PortalGroup>): Result<List<PortalGroup>>

Shares this PortalItem with the specified portal groups. It's not necessary to load the PortalGroup objects that are passed to this method.

Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.

Link copied to clipboard
suspend fun unshare(): Result<Unit>

Unshares this item with everyone which will make the item PortalAccess.Private.

Link copied to clipboard
suspend fun unshareGroups(groups: Iterable<PortalGroup>): Result<List<PortalGroup>>

Stops sharing this PortalItem with the specified list of portal groups. It's not necessary to load the PortalGroup objects that are passed to this method.

Link copied to clipboard
suspend fun updateContent(contentParameters: PortalItemContentParameters): Result<Unit>

Update the portal item with the given PortalItemContentParameters.

Link copied to clipboard
suspend fun updateItemProperties(): Result<Unit>

Updates an item's properties in a file on disk when this item instance is a LocalItem. This method resides in the Item base class to match the public API, but within the C API it's implemented only on LocalItem and PortalItem simply throws an exception. The client APIs provide their own implementations of this method for PortalItems.

Properties

Link copied to clipboard
val access: PortalAccess
Link copied to clipboard
var accessInformation: String

The information on the source of the item and its copyright status.

Link copied to clipboard
val averageRating: Float
Link copied to clipboard
val commentCount: Int
Link copied to clipboard
val commentsEnabled: Boolean

A flag indicating whether the comments are allowed on the portal item. Will return false if an error occurs.

Link copied to clipboard
val created: Instant?
Link copied to clipboard
val culture: String

The culture of the portal item. The culture (language and country) of the portal item.

Link copied to clipboard
var description: String

The description of the specified item.

Link copied to clipboard
var extent: Envelope?
Link copied to clipboard
var folderId: String?

The folder ID of the portal item. A null folderID means either an error or that the folderID is unknown i.e. that the portal item request was done without the credentials allowing to access to the user item. An empty folderID means that the item is stored at the root folder of the user directory.

Link copied to clipboard
var itemId: String

The item ID of the specified item. Item ID can only be set on not loaded item.

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Link copied to clipboard
val modified: Instant?
Link copied to clipboard
var name: String

The name of this item.

Link copied to clipboard
var owner: String

The username of the user who owns this portal item.

Link copied to clipboard
val portal: Portal
Link copied to clipboard
val ratingCount: Int
Link copied to clipboard
val serviceUrl: String
Link copied to clipboard
val size: Long

The size of the portal item. Will return -1 if an error occurs.

Link copied to clipboard
var snippet: String

The short summary description of the specified item. A short summary description of the item.

Link copied to clipboard
val spatialReferenceName: String

The spatial reference name of the specified item. The coordinate system of the specified item.

Link copied to clipboard
val tags: MutableList<String>
Link copied to clipboard
var termsOfUse: String

The terms of use of the item. It is stored in the "licenseInfo" property in json. The property can contain HTML markup.

Link copied to clipboard
val thumbnail: LoadableImage?
Link copied to clipboard
var title: String

The title of the specified item. This is the name that's displayed to users and by which they refer to the item. Every item must have a title.

Link copied to clipboard
var type: PortalItemType

The GIS content type of this portal item. A portal item's type cannot be changed once it has an item ID.

Link copied to clipboard
val typeKeywords: MutableList<String>
Link copied to clipboard
val typeName: String

The type name of this portal item. Most generally the type name is the string representation of the enum PortalItemType returned by PortalItem.type. However if the type is PortalItemType.Unknown, the type name is set with the type found in the portal item JSON. This allows API to deal with new portal item types added since the latest API release.

Link copied to clipboard
open override val unknownJson: Map<String, Any>

Unknown data from the source JSON. Unknown JSON is a dictionary of values that was in the source JSON but was unparsed by this API.

Link copied to clipboard
open override val unsupportedJson: Map<String, Any>

Unsupported data from the source JSON. Unsupported JSON is a dictionary of values that are supported by web maps, but not exposed through this API.

Link copied to clipboard
val url: String
Link copied to clipboard
val viewCount: Int

The number of views of the portal item. Will return -1 if an error occurs.