OSID Logo
OSID Specifications
learning package
Version 3.0.0
Release Candidate Preview
Interfaceosid.learning.ActivityAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Activities. 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 an Activity, an ActivityForm is requested using getActivityFormForCreate() specifying the desired objective and record Types or none if no record Types are needed. The returned ActivityForm 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 ActivityForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each ActivityForm corresponds to an attempted transaction.

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

The delete operations delete Activities. To unmap an Activity from the current ObjectiveBank, the ActivityObjectiveBankAssignmentSession should be used. These delete operations attempt to remove the Activity itself thus removing it from all known ObjectiveBank catalogs.

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

MethodgetObjectiveBankId
Description

Gets the ObjectiveBank Id associated with this session.

Returnosid.id.Idthe ObjectiveBank Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetObjectiveBank
Description

Gets the ObjectiveBank associated with this session.

Returnosid.learning.ObjectiveBankthe ObjectiveBank associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateActivities
Description

Tests if this user can create Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Activity 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 Activity creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateActivityWithRecordTypes
Description

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

Parametersosid.type.Type[]activityRecordTypesarray of activity record types
Returnboolean true if Activity creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT activityRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetActivityFormForCreate
Description

Gets the activity form for creating new activities. A new form should be requested for each create transaction.

Parametersosid.id.IdobjectiveIdthe Id of the Objective
osid.type.Type[]activityRecordTypesarray of activity record types
Returnosid.learning.ActivityFormthe activity form
ErrorsNOT_FOUND objectiveId is not found
NULL_ARGUMENT objectiveId or activityRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateActivity
Description

Creates a new Activity.

Parametersosid.learning.ActivityFormactivityFormthe form for this Activity
Returnosid.learning.Activitythe new Activity
ErrorsILLEGAL_STATE activityForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT activityForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED activityForm did not originate from getActivityFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateActivities
Description

Tests if this user can update Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Activity 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 activity modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetActivityFormForUpdate
Description

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

Parametersosid.id.IdactivityIdthe Id of the Activity
Returnosid.learning.ActivityFormthe activity form
ErrorsNOT_FOUND activityId is not found
NULL_ARGUMENT activityId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateActivity
Description

Updates an existing activity,

Parametersosid.learning.ActivityFormactivityFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE activityForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT activityForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED activityForm did not originate from getActivityFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteActivities
Description

Tests if this user can delete Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Activity 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 Activity deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteActivity
Description

Deletes the Activity identified by the given Id.

Parametersosid.id.IdactivityIdthe Id of the Activity to delete
ErrorsNOT_FOUNDan Activity was not found identified by the given Id
NULL_ARGUMENT activityId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageActivityAliases
Description

Tests if this user can manage Id aliases for activities. 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 Activity aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasActivity
Description

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

Parametersosid.id.IdactivityIdthe Id of an Activity
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND activityId not found
NULL_ARGUMENT activityId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.