public interface SyllabusBatchAdminSession extends SyllabusAdminSession
This session creates, updates, and deletes Syllabi in bulk. 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 Syllabus, a SyllabusForm is requested using getSyllabusFormsForCreate() specifying the desired course and record Types or none if no record Types are needed. Each of the returned SyllabusForms 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 a SyllabusForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each SyllabusForm corresponds to an attempted transaction.
The SyllabusForms returned from getSyllabusFormsForCreate() may be linked to the originating request through the peer Ids of the SyllabusForm. In the case where there may be duplicates, any SyllabusForm of the same peer Ids may be used for a create operation.
Once a batch of SyllabusForms are submitted for create, a CreateResponse is returned for each SyllabusForm, although the ordering is not defined. Only errors that pertain to the entire create operation are returned from createSyllabi(), errors specific to an individual SyllabusForm are indicated in the corresponding CreateResponse. CreateResponses may be linked to the originating SyllabusForm through the SyllabusForm Id.
For updates, SyllabusForms
are requested to the
Syllabus
Id
that is to be updated using
getSyllabusFormsForUpdate()
where the reference Id
in the SyllabusForm
may be used to link the request.
Similarly, the SyllabusForm
has metadata about the data
that can be updated and it can perform validation before submitting the
update. The SyllabusForm
can only be used once for a
successful update and cannot be reused.
Once a batch of SyllabusForms
are submitted for update,
an UpdateResponse
is returned for each SyllabusForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateSyllabi(),
errors specific to an individual SyllabusForm
are
indicated in the corresponding UpdateResponse.
UpdateResponses
may be linked to the originating
SyllabusForm
through the SyllabusForm
Id.
The delete operations delete Syllabi
in bulk. To unmap
a Syllabus
from the current CourseCatalog,
the SyllabusCourseCatalogAssignmentSession
should be used.
These delete operations attempt to remove the Syllabus
itself thus removing it from all known CourseCatalog
catalogs. Bulk delete operations return the results in
DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasSyllabi(AliasRequestList aliasRequests)
Adds an
Id to a Syllabus for the purpose
of creating compatibility. |
CreateResponseList |
createSyllabi(SyllabusBatchFormList syllabusForms)
Creates a new set of
Syllabi. |
DeleteResponseList |
deleteAllSyllabi()
Deletes all
Syllabi in this CourseCatalog
. |
DeleteResponseList |
deleteSyllabi(IdList syllabusIds)
Deletes syllabi for the given
Ids. |
DeleteResponseList |
deleteSyllabiForCourse(Id courseId)
Deletes syllabi for the given course.
|
SyllabusBatchFormList |
getSyllabusFormsForCreate(IdList courseIds,
Type[] syllabusRecordTypes)
Gets the syllabus forms for creating a bunch of new syllabi.
|
SyllabusBatchFormList |
getSyllabusFormsForUpdate(IdList syllabusIds)
Gets the syllabus forms for updating an existing set of syllabi.
|
UpdateResponseList |
updateSyllabi(SyllabusBatchFormList syllabusForms)
Updates existing syllabi.
|
aliasSyllabus, canCreateSyllabi, canCreateSyllabusWithRecordTypes, canDeleteSyllabi, canManageSyllabusAliases, canUpdateSyllabi, createSyllabus, deleteSyllabus, getCourseCatalog, getCourseCatalogId, getSyllabusFormForCreate, getSyllabusFormForUpdate, updateSyllabus
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
SyllabusBatchFormList getSyllabusFormsForCreate(IdList courseIds, Type[] syllabusRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
courseIds
- a list of course Ids
syllabusRecordTypes
- array of syllabus record types to be
included in each create operation or an empty list if noneNotFoundException
- a courseId
is not
foundNullArgumentException
- courseIds
or
syllabusRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createSyllabi(SyllabusBatchFormList syllabusForms) throws OperationFailedException, PermissionDeniedException
Syllabi.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.syllabusForms
- the syllabus formsNullArgumentException
- syllabusForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. SyllabusBatchFormList getSyllabusFormsForUpdate(IdList syllabusIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
syllabusIds
- the Ids
of the Syllabus
NotFoundException
- a syllabusId
is not
foundNullArgumentException
- syllabusIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateSyllabi(SyllabusBatchFormList syllabusForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.syllabusForms
- the form containing the elements to be updatedNullArgumentException
- syllabusForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllSyllabi() throws OperationFailedException, PermissionDeniedException
Syllabi
in this CourseCatalog
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteSyllabi(IdList syllabusIds) throws OperationFailedException, PermissionDeniedException
Ids.
syllabusIds
- the Ids
of the syllabi to deleteNullArgumentException
- syllabusIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteSyllabiForCourse(Id courseId) throws OperationFailedException, PermissionDeniedException
courseId
- a course Id
NullArgumentException
- courseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasSyllabi(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a Syllabus
for the purpose
of creating compatibility. The primary Id
of the
Syllabus
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is
a pointer to another syllabus, it is reassigned to the given syllabus
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.