OSID Logo
OSID Specifications
mapping package
Version 3.1.0
Interfaceosid.mapping.LocationAdminSession
Implementsosid.OsidSession
Implemented Byosid.mapping.batch.LocationBatchAdminSession
Used Byosid.mapping.MappingManager
osid.mapping.MappingProxyManager
Description

This session creates, updates, and deletes Locations. The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Location, a LocationForm is requested using getLocationFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned LocationForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the LocationForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each LocationForm corresponds to an attempted transaction.

For updates, LocationForms are requested to the Location Id that is to be updated using getLocationFormForUpdate(). Similarly, the LocationForm has metadata about the data that can be updated and it can perform validation before submitting the update. The LocationForm can only be used once for a successful update and cannot be reused.

The delete operations delete Locations. To unmap a Location from the current Map, the LocationMapAssignmentSession should be used. These delete operations attempt to remove the Location itself thus removing it from all known Map catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetMapId
Description

Gets the Map Id associated with this session.

Returnosid.id.Id the Map Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetMap
Description

Gets the Map associated with this session.

Returnosid.mapping.Map the map
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanCreateLocations
Description

Tests if this user can create Locations. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Location will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Location creation is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodcanCreateLocationWithRecordTypes
Description

Tests if this user can create a single Location using the desired record types. While MappingManager.getLocationRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Location. Providing an empty array tests if a Location can be created with no records.

Parametersosid.type.Type[]locationRecordTypes array of location record types
Returnboolean true if Location creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT locationRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetLocationFormForCreate
Description

Gets the location form for creating new locations. A new form should be requested for each create transaction.

Parametersosid.type.Type[]locationRecordTypes array of location record types
Returnosid.mapping.LocationForm the location form
ErrorsNULL_ARGUMENT locationRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get a form with given record types
Compliancemandatory This method must be implemented.
MethodcreateLocation
Description

Creates a new Location.

Parametersosid.mapping.LocationFormlocationForm the form for this Location
Returnosid.mapping.Location the new Location
ErrorsILLEGAL_STATE locationForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT locationForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED locationForm did not originate from getLocationFormForCreate()
Compliancemandatory This method must be implemented.
MethodcanUpdateLocations
Description

Tests if this user can update Locations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Location will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if Location modification is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetLocationFormForUpdate
Description

Gets the location form for updating an existing location. A new location form should be requested for each update transaction.

Parametersosid.id.IdlocationId the Id of the Location
Returnosid.mapping.LocationForm the location form
ErrorsNOT_FOUND locationId is not found
NULL_ARGUMENT locationId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateLocation
Description

Updates an existing location.

Parametersosid.mapping.LocationFormlocationForm the form containing the elements to be updated
ErrorsILLEGAL_STATE locationForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT locationId or locationForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED locationForm did not originate from getLocationFormForUpdate()
Compliancemandatory This method must be implemented.
MethodcanDeleteLocations
Description

Tests if this user can delete Locations. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Location will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Location deletion is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethoddeleteLocation
Description

Deletes a Location.

Parametersosid.id.IdlocationId the Id of the Location to remove
ErrorsNOT_FOUND locationId not found
NULL_ARGUMENT locationId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageLocationAliases
Description

Tests if this user can manage Id aliases for Locations. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if Location aliasing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodaliasLocation
Description

Adds an Id to a Location for the purpose of creating compatibility. The primary Id of the Location is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another location, it is reassigned to the given location Id.

Parametersosid.id.IdlocationId the Id of a Location
osid.id.IdaliasId the alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND locationId not found
NULL_ARGUMENT locationId or aliasId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.