OSID Logo
OSID Specifications
mapping package
Version 3.0.0
Release Candidate Preview
Interfaceosid.mapping.LocationAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Locations. The data for create and update is provided by the consumer via the form object. 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.Idthe Map Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetMap
Description

Gets the Map associated with this session.

Returnosid.mapping.Mapthe map
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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
CompliancemandatoryThis 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[]locationRecordTypesarray of location record types
Returnboolean true if Location creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT locationRecordTypes is null
CompliancemandatoryThis 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[]locationRecordTypesarray of location record types
Returnosid.mapping.LocationFormthe location form
ErrorsNULL_ARGUMENT locationRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get a form with given record types
CompliancemandatoryThis method must be implemented.
MethodcreateLocation
Description

Creates a new Location.

Parametersosid.mapping.LocationFormlocationFormthe form for this Location
Returnosid.mapping.Locationthe new Location
ErrorsILLEGAL_STATE locationForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT locationForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED locationForm did not originate from getLocationFormForCreate()
CompliancemandatoryThis 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
CompliancemandatoryThis 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.IdlocationIdthe Id of the Location
Returnosid.mapping.LocationFormthe location form
ErrorsNOT_FOUND locationId is not found
NULL_ARGUMENT locationId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateLocation
Description

Updates an existing location.

Parametersosid.mapping.LocationFormlocationFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE locationForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT locationId or locationForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED locationForm did not originate from getLocationFormForUpdate()
CompliancemandatoryThis 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
CompliancemandatoryThis method must be implemented.
MethoddeleteLocation
Description

Deletes a Location.

Parametersosid.id.IdlocationIdthe Id of the Location to remove
ErrorsNOT_FOUND locationId not found
NULL_ARGUMENT locationId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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
CompliancemandatoryThis 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.IdlocationIdthe Id of a Location
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND locationId not found
NULL_ARGUMENT locationId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.