ArcGIS Runtime SDK for iOS
100.15
|
Object representing a unit of content in an ArcGIS portal.
An AGSPortalItem
is a unit of content in the AGSPortal
object. 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 has to be fetched explicitly using fetchDataWithCompletion: (AGSItem)
. For example, an item of type AGSPortalItemTypeMapPackage
will fetch the actual bits corresponding to the map package.
Class Methods | |
(nullable id< AGSJSONSerializable >) | + fromJSON:error: |
(nullable AGSPortalItem *) | + fromJSON:withPortal:error: |
(instancetype) | + portalItemWithPortal: |
(instancetype) | + portalItemWithPortal:itemID: |
(instancetype) | + portalItemWithPortal:type: |
(nullable instancetype) | + portalItemWithURL: |
- (id<AGSCancelable>) addComment: | (NSString *) | comment | |
completion: | (nullable void(^)(AGSPortalItemComment *__nullable resultComment, NSError *__nullable error)) | completion | |
Kicks off an operation to add a comment to an item. Available only to authenticated users who have access to the item. The completion block is invoked when the operation completes successfully or if an error is encountered.
comment | The comment to add to the portal item. |
completion | A block that is invoked when operation finishes. |
- (id<AGSCancelable>) addRating: | (CGFloat) | rating | |
completion: | (nullable void(^)(NSError *__nullable error)) | completion | |
Kicks off an operation to add a rating to an item that the current portal user has access to. The completion block is invoked when the operation completes successfully or if an error is encountered. Upon success, the #avgRating
and #numRatings
will be updated on the portal item.
If the current user's rating has not been fetched, this method will fetch it before adding the rating. 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.
rating | The rating to add to the portal item. The value must be between 1.0 and 5.0 . |
completion | A block that is invoked when operation finishes. |
|
requiredinherited |
Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion:
or retryLoadWithCompletion:
to complete and this will call them all back with the error of NSUserCancelledError
- (id<AGSCancelable>) fetchCommentsWithCompletion: | (nullable void(^)(NSArray< AGSPortalItemComment * > *__nullable comments, NSError *__nullable error)) | completion |
Kicks off an operation to fetch user comments (AGSPortalItemComment
objects) for the item. The completion block is invoked when the operation completes successfully or if an error is encountered. Once completed the comments
property will be populated.
completion | block that is invoked when operation finishes. |
- (id<AGSCancelable>) fetchDataWithCompletion: | (void(^)(NSData *__nullable data, NSError *__nullable error)) | completion |
Kicks off an operation to fetch the raw bytes for the item. The completion block is invoked when the operation completes successfully or if an error is encountered.
completion | block that is invoked when operation finishes |
- (id<AGSCancelable>) fetchGroupsWithCompletion: | (nullable void(^)(NSArray< AGSPortalGroup * > *__nullable adminGroups, NSArray< AGSPortalGroup * > *__nullable memberGroups, NSArray< AGSPortalGroup * > *__nullable otherGroups, NSError *__nullable error)) | completion |
Kicks off an operation to fetch the groups (AGSPortalGroup
objects) that this item belongs to. The completion block is invoked when the operation completes successfully or if an error is encountered. Only those groups that are visible to the current portal user will be returned. Once completed the adminGroups
, memberGroups
and, otherGroups
properties will be populated.
completion | A block that is invoked when operation finishes with details about adminGroups , memberGroups , otherGroups that this item belongs to. |
- (id<AGSCancelable>) fetchRelatedItemsWithRelationship: | (AGSPortalItemRelationship) | relationship | |
direction: | (AGSPortalItemRelationshipDirection) | direction | |
completion: | (void(^)(NSArray< AGSPortalItem * > *__nullable result, NSError *__nullable error)) | completion | |
Fetches all related portal items with the specified relationship to this portal item.
relationship | The relationship. |
direction | The direction of the relationship. |
completion | A block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
- (id<AGSCancelable>) fetchRelatedItemsWithRelationships: | (NSArray< NSValue * > *) | relationships | |
direction: | (AGSPortalItemRelationshipDirection) | direction | |
completion: | (void(^)(NSArray< AGSPortalItem * > *__nullable result, NSError *__nullable error)) | completion | |
Fetches all related portal items with any of the specified relationships to this portal item.
relationships | An array of relationships. |
direction | The direction of the relationships. |
completion | A block that is invoked when the operation finishes. The result parameter is populated if the operation completed successfully, otherwise the error parameter is populated. |
|
staticrequiredinherited |
Initializes and returns an object from its JSON representation.
JSONObject | NSDictionary or NSArray containing the JSON. |
error | encountered during the operation, if any. |
+ (nullable AGSPortalItem *) fromJSON: | (id) | JSONObject | |
withPortal: | (AGSPortal *) | portal | |
error: | (NSError **) | error | |
Creates a portal item with JSON content to represent an existing item in the portal.
JSONObject | Representing the JSON content of the item. |
portal | The portal to which the item belongs to. |
- (instancetype) initWithPortal: | (AGSPortal *) | portal |
Creates a new portal item object for a specified portal. This constructor is used if you wish to create a new item that you will add to a portal.
portal | The portal. |
AGSPortalItem::portal
initWithPortal:type:
instead. Provided by category AGSPortalItem(AGSDeprecated).
- (instancetype) initWithPortal: | (AGSPortal *) | portal | |
itemID: | (NSString *) | itemID | |
Creates a portal item object for a specified portal and a specified item ID. Use this initializer to instantiate an AGSPortalItem
object from an existing item using its unique ID. The portal item ID can be determined from the URL of the item details web page or the map viewer and scene viewer web applications in your portal. The item details page has the following format https://www.arcgis.com/home/item.html?id=[item_id]. The map viewer has the format https://www.arcgis.com/home/webmap/viewer.html?webmap=[item_id] or https://www.arcgis.com/apps/mapviewer/index.html?webmap=[item_id] depending on whether you use the classic map viewer or the new map viewer. The scene viewer has the following format https://www.arcgis.com/home/webscene/viewer.html?webscene=[item_id]. In all cases, the [item_id] can be used as the ID to instantiate a portal item.
portal | The portal to which the item belongs to. |
itemID | The ID of the existing item in the portal. |
- (instancetype) initWithPortal: | (AGSPortal *) | portal | |
type: | (AGSPortalItemType) | type | |
Creates a new portal item object with the specified type for a specified portal. This initializer is used if you wish to create a new item that you will add to a portal.
portal | The portal. |
type | The type of the new portal item. |
AGSPortalItem::portal
, @C AGSPortalItem::type - (nullable instancetype) initWithURL: | (NSURL *) | URL |
Creates a portal item based on the given URL.
The supported URL formats are:
URL | of the portal item on ArcGIS Online or an on-premises portal. |
|
requiredinherited |
Loads data for the object asynchronously. The completion block is invoked upon completion.
You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- cancelLoad
to cancel loading - retryLoadWithCompletion:
to force reload + (instancetype) portalItemWithPortal: | (AGSPortal *) | portal |
Creates a new portal item object for a specified portal. This constructor is used if you wish to create a new item that you will add to a portal.
portal | The portal. |
AGSPortalItem::portal
initWithPortal:type:
instead. Provided by category AGSPortalItem(AGSDeprecated).
+ (instancetype) portalItemWithPortal: | (AGSPortal *) | portal | |
itemID: | (NSString *) | itemID | |
Creates a portal item object for a specified portal and a specified item ID. The portal item ID can be determined from the URL of the item details web page or the map viewer and scene viewer web applications in your portal. The item details page has the following format https://www.arcgis.com/home/item.html?id=[item_id]. The map viewer has the format https://www.arcgis.com/home/webmap/viewer.html?webmap=[item_id] or https://www.arcgis.com/apps/mapviewer/index.html?webmap=[item_id] depending on whether you use the classic map viewer or the new map viewer. The scene viewer has the following format https://www.arcgis.com/home/webscene/viewer.html?webscene=[item_id]. In all cases, the [item_id] can be used as the ID to instantiate a portal item.
portal | The portal to which the item belongs to. |
itemID | The ID of the existing item in the portal. |
+ (instancetype) portalItemWithPortal: | (AGSPortal *) | portal | |
type: | (AGSPortalItemType) | type | |
Creates a portal item object with the specified type for a specified portal. This method is used if you wish to create a new item that you will add to a portal.
portal | The portal. |
type | The type of the new portal item. |
AGSPortalItem::portal
, @C AGSPortalItem::type + (nullable instancetype) portalItemWithURL: | (NSURL *) | URL |
Creates a portal item based on the given URL.
The supported URL formats are:
URL | of the portal item on ArcGIS Online or an on-premises portal |
nil
if an invalid URL is passed.
|
requiredinherited |
Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:
cancelLoad
and then this methodIf the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- (void) setThumbnailWithImage: | (nullable AGSImage *) | image |
Sets the thumbnail for this item.
image | The NSImage/UIImage representing the thumbnail. The recommended image size is 200 pixels wide by 133 pixels high. Acceptable image formats are PNG, GIF, and JPEG. The maximum file size for an image is 1 MB. |
- (__nullable id) toJSON: | (NSError **) | error |
Returns JSON representation for this object.
NSDictionary
or NSArray
containing the JSON. Reimplemented from <AGSJSONSerializable>.
|
readnonatomiccopy |
The GUID of this portal item.
AGSItem.itemID
provides a unique identifier of the item. Provided by category AGSPortalItem(AGSDeprecated).
|
readnonatomicassign |
Indicates who can access this item. Can be AGSPortalAccessPrivate
, AGSPortalAccessShared
, AGSPortalAccessOrganization
, or AGSPortalAccessPublic
.
If AGSPortalAccessPrivate
, only the item owner can access. AGSPortalAccessShared
allows access to members of a group that the item is shared with. AGSPortalAccessOrganization
restricts item access to members of an organization. If AGSPortalAccessPublic
, all users can access the item.
|
readwritenonatomiccopy |
Information about licenses or restrictions to view or edit the item.
termsOfUse
instead. Provided by category AGSPortalItem(AGSDeprecated).
|
readwritenonatomiccopyinherited |
The access information about the item.
|
readnonatomiccopy |
Groups (AGSPortalGroup
objects) that this item belongs to which the current portal user is an administrator. Will be nil
if they haven't been fetched yet. Use fetchGroupsWithCompletion:
to fetch the groups.
|
readnonatomicassign |
Average rating of the item.
|
readnonatomicassign |
The number of comments on the item.
|
readnonatomiccopy |
Array of comments (AGSPortalItemComment
) of the item. These need to be fetched explicitly using fetchCommentsWithCompletion:
.
|
readnonatomicassign |
Indicates whether or not comments are enabled for the item.
|
readnonatomicstronginherited |
Date on which the item was first saved.
|
readwritenonatomicstronginherited |
The default extent of the item. Only applicable to certain item types.
|
readnonatomiccopy |
The ID of the folder this item belongs to.
|
readwritenonatomiccopyinherited |
The description of the item, if any.
|
readnonatomiccopyinherited |
The ID of the item.
|
readnonatomicstronginherited |
The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.
|
readrequirednonatomicassigninherited |
Status of the load operation.
|
readnonatomicstrong |
The item's language and country information.
|
readnonatomiccopy |
Groups (AGSPortalGroup
objects) that this item belongs to which the current portal user is a member. Will be nil
if they haven't been fetched yet. Use fetchGroupsWithCompletion:
to fetch the groups.
|
readnonatomicstronginherited |
Date on which the item was modified.
|
readnonatomiccopyinherited |
The file name of the item for file types.
|
readnonatomiccopy |
Groups (AGSPortalGroup
objects) that this item belongs to that are public or shared to the user's organization, but that the current portal user is not a member of. Will be nil
if they haven't been fetched yet. Use fetchGroupsWithCompletion:
to fetch the groups.
|
readwritenonatomiccopy |
The user who created the item.
|
readnonatomicstrong |
The portal that the item belongs to.
|
readnonatomicassign |
The number of ratings made by the users on the item.
|
readnonatomicstrong |
The URL of the service inside the portal item.
|
readnonatomicassign |
The size of the item in bytes.
|
readwritenonatomiccopyinherited |
Snippet or summary of the item with a character limit of 250 characters.
|
readwritenonatomiccopyinherited |
Spatial reference of the geographic content
|
readwritenonatomiccopyinherited |
The user defined tags that describe the specified item.
|
readwritenonatomiccopyinherited |
The terms of use of the item. It is stored in the "licenseInfo" property in json. The property can contain HTML markup.
|
readnonatomicstronginherited |
The thumbnail image of the item. The image needs to be loaded asynchronously by calling loadWithCompletion: (AGSLoadable-p)
If it is nil, there is no item thumbnail.
|
readwritenonatomiccopyinherited |
Title of the item.
|
readwritenonatomicassign |
The type of the item.
|
readwritenonatomiccopyinherited |
An array of keywords that further describes the type of item. Each item is tagged with a set of type keywords that are derived based on its primary type.
|
readnonatomiccopy |
The type of the item represented as a string.
|
readrequirednonatomiccopyinherited |
A dictionary of values that was in the source JSON but was unparsed by API.
NSDictionary
containing the unknown JSON.
|
readnonatomiccopyinherited |
A dictionary of values that are supported by the REST API, but not exposed through the SDK API.
NSDictionary
containing the unsupported JSON.
|
readnonatomicstrong |
The user rating of the item.
If it is nil
, there is no rating. Otherwise, the rating is number that needs to be loaded asynchronously by calling loadWithCompletion: (AGSLoadable-p)
.
|
readnonatomicassign |
Number of times a file item type is downloaded for the first time or a text item type is opened. For a URL item type, the numViews property increases the first time a service is opened.