An Object representing a Portal for ArcGIS.
AGSPortal is an object that represents a view for a user (anonymous or not) into a portal. www.ArcGIS.com is an example of a portal. A portal may support subscriptions which provides organizations a sandboxed area on the portal.
AGSPortal is the main class and the entry point into the API to work with portals and organization subscriptions. It implements all the operations to interface with the backend ArcGIS Portal REST API.
Concepts:
- Portals allow users and organizations to publish and share content over the web.
- A Portal has Users (
AGSPortalUser
), Groups (AGSPortalGroup
) and Content (AGSPortalItem
).
- A Portal may have users who are unaffiliated with an organization or users who are part of an organization.
- Users sign in to the portal and create and share content which is organized into Items. The system supports different types of items including web maps, map services (that can be used as layers in web maps), applications (that are built around web maps) and data files (that can be uploaded and downloaded).
- Users can choose to keep content Private or to share it with other users via Groups or make content Public and accessible to everyone.
- Users can create and join Groups. Users can share items with Groups. This makes the items visible to and accessible by the other members of the Group.
- A Portal may contain multiple Organizations.
- A user of the Portal (and of the REST API) sees the view off the Portal that applies to their organization subscription. This view includes users, groups and items that belong to the organization and have been shared with them. This view may also include users, groups and items that are external to the organization and have been shared with the user.
- An organization has users in different roles including administrators, publishers and information workers.
- Administrators can add users to their organization subscriptions and have access to all content within the organization.
- All users can create web maps based on mashing up services that they have access to and can register services running on external servers.
- Publishers within an organization can in addition create hosted services based on data files that they upload.
- Since
- 100
+ (instancetype) ArcGISOnlineWithLoginRequired: |
|
(BOOL) |
loginRequired |
|
Instantiates a new AGSPortal pointing to www.arcgis.com. You should load the portal by calling loadWithCompletion: (AGSLoadable-p) before using it. This is not a singleton and retuns a new portal whenever it's called.
ArcGIS Online, permits anonymous access. If you want to connect to the portal anonymously, you should set loginRequired
to false. But if you want to connect to the portal using an identity, you should set loginRequired
to true. This will ensure that API propogates the credential
to the portal. If a credential is not available, an authentication challenge will be issued to first request a credential.
- Parameters
-
loginRequired | Whether or not you intend to access the portal anonymously or if you want to use a credential. If set to YES, authentication challenge will be issued. If set to NO, the portal will be accessed anonymously. If the portal does not permit anonymous access, an authentication challenge will be issued. After you instantiate the portal, if you set a credential then the credential you set will be used regardless of the loginRequired parameter. |
- Since
- 100
- (instancetype) initWithURL: |
|
(NSURL *) |
url |
loginRequired: |
|
(BOOL) |
loginRequired |
|
|
| |
Instantiates the AGSPortal with a URL. You should load the portal by calling loadWithCompletion: (AGSLoadable-p) before using it.
Some portals, for instance ArcGIS Online, permit anonymous access. If you want to connect to the portal anonymously, you should set loginRequired
to false. But if you want to connect to the portal using an identity, you should set loginRequired
to true. This will ensure that API propogates the credential
to the portal. If a credential is not available, an authentication challenge will be issued to first request a credential.
If the portal does not permit anonymous access, the value of loginRequired
parameter is ignored. The API will attempt to propogate the credential
to the portal. If a credential is not available, an authentication challenge will be issued to first request a credential.
- Parameters
-
url | The url for the portal. Eg, www.arcgis.com |
loginRequired | Whether or not you intend to access the portal anonymously or if you want to use a credential. If set to YES, authentication challenge will be issued. If set to NO, the portal will be accessed anonymously. If the portal does not permit anonymous access, an authentication challenge will be issued. After you instantiate the portal, if you set a credential then the credential you set will be used regardless of the loginRequired parameter. |
- Since
- 100
- (void) loadWithCompletion: |
|
(nullable void(^)(NSError *__nullable error)) |
completion |
|
|
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.
- Parameters
-
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. |
- Note
- The completion block is always invoked on the main thread.
- Since
- 100
- See also
- cancelLoad
to cancel loading
-
- retryLoadWithCompletion:
to force reload
+ (instancetype) portalWithURL: |
|
(NSURL *) |
URL |
loginRequired: |
|
(BOOL) |
loginRequired |
|
|
| |
Instantiates the AGSPortal with a URL. You should load the portal by calling loadWithCompletion: (AGSLoadable-p) before using it.
Some portals, for instance ArcGIS Online, permit anonymous access. If you want to connect to the portal anonymously, you should set loginRequired
to false. But if you want to connect to the portal using an identity, you should set loginRequired
to true. This will ensure that API propogates the credential
to the portal. If a credential is not available, an authentication challenge will be issued to first request a credential.
If the portal does not permit anonymous access, the value of loginRequired
parameter is ignored. The API will attempt to propogate the credential
to the portal. If a credential is not available, an authentication challenge will be issued to first request a credential.
- Parameters
-
URL | The url for the portal. Eg, www.arcgis.com |
loginRequired | Whether or not you intend to access the portal anonymously or if you want to use a credential. If set to YES, authentication challenge will be issued. If set to NO, the portal will be accessed anonymously. If the portal does not permit anonymous access, an authentication challenge will be issued. After you instantiate the portal, if you set a credential then the credential you set will be used regardless of the loginRequired parameter. |
- Since
- 100
- (void) retryLoadWithCompletion: |
|
(nullable void(^)(NSError *__nullable error)) |
completion |
|
|
requiredinherited |
Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:
- you didn't have network connectivity earlier when it failed and you want to retry now that you have connectivity
- the server was down earlier when it failed and you want to retry
- the request is taking too long and you want to cancel it and retry, in which case you will first call
cancelLoad
and then this method
If 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.
- Parameters
-
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. |
- Note
- The completion block is always invoked on the main thread.
- Since
- 100