PortalItem

@Serializable(with = PortalItemSerializer::class)
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

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

The username of the user who owns this portal item.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val size: Long

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

Link copied to clipboard

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

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
Link copied to clipboard
Link copied to clipboard
val url: String
Link copied to clipboard

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

Inherited properties

Link copied to clipboard

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

Link copied to clipboard

The date the item was created.

Link copied to clipboard

The description of the specified item.

Link copied to clipboard

The extent of the specified item.

Link copied to clipboard

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

The date the item was last modified.

Link copied to clipboard

The name of this item.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

The user defined tags that describe the specified item.

Link copied to clipboard

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

The thumbnail of the item.

Link copied to clipboard

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

An array 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 type keywords of the specified item.

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

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

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

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

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

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

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
suspend fun unshare(): Result<Unit>

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

Link copied to clipboard

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
open suspend override fun updateItemProperties(): Result<Unit>

Executes an asynchronous operation to update any item properties that have been changed (using the setter methods). This causes the values that have been changed to be updated on the portal (for PortalItems) or on disk (for LocalItems).

Inherited functions

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

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

Fetches the item's data.

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

Sets the thumbnail of the item with the specified image. This method invokes Bitmap.compress and may be long running.

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

Convert an object to JSON string.