| Visual Basic (Declaration) | |
|---|---|
Public Function GetItemsTaskAsync() As Task(Of IEnumerable(Of ArcGISPortalItem)) | |
| C# | |
|---|---|
public Task<IEnumerable<ArcGISPortalItem>> GetItemsTaskAsync() | |
The purpose of this Method is to obtain Portal.ArcGISPortalItems that belong to a particular authenticated user for nested sub-folders in their ArcGIS Online (AGOL) and ArcGIS Portal account. This method performs an asynchronous request to obtain an IEnumerable of Portal.ArcGISPortalItem objects for the credentialed logged in user via the IdentityManager. You cannot use anonymous access to obtain a Portal.ArcGISPortalFolder object and use this Method to obtain valid results. As AGOL/ArcGIS Portal require the use of long term tokens to access secured user information, you should remember to set the IdentityManager.TokenGenerationReferer Property to the correct string required by your development platform.
It is a recommended best practice to call the Portal.ArcGISPortal.InitializeAsync Method to initialize the Portal.ArcGISPortal object such that the credentialed Portal.ArcGISPortal.CurrentUser can be obtained. Then for the credentialed user, call the Portal.ArcGISPortalUser.GetFoldersAsync Method to obtain an IEnumerable of Portal.ArcGISPortalFolder objects for which this Method can be used. It is not recommended to try an obtain Portal.ArcGISPortalUser objects via the following Methods and Properties, because the returned users are not authenticated credentialed users and you will not be able to obtain sub-folder information: Portal.ArcGISPortal.SearchUsersAsync, Portal.ArcGISPortalGroup.GetGroupUsersAsync, and Portal.ArcGISPortalInfo.QueryUsersAsync.
To obtain Portal.ArcGISPortalItem objects that exist at the root level of the user account on AGOL/ArcGIS Portal use the Portal.ArcGISPortalUser.GetItemsAsync Method.
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8