Interface SyllabusAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
SyllabusBatchAdminSession
This session creates, updates, and deletes Syllabi . 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
getSyllabusFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
SyllabusForm 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 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.
For updates, SyllabusForms are requested to the
Syllabus Id that is to be updated using
getSyllabusFormForUpdate() . 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.
The delete operations delete Syllabi . To unmap a
Syllabus from the current CourseCatalog , the
SyllabusCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the SyllabusForm itself thus removing
it from all known CourseCatalog catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasSyllabus(Id syllabusId, Id aliasId) Adds anIdto aSyllabusfor the purpose of creating compatibility.booleanTests if this user can create syllabi.booleancanCreateSyllabusWithRecordTypes(Type[] syllabusRecordTypes) Tests if this user can create a singleSyllabususing the desired record types.booleanTests if this user can delete syllabi.booleanTests if this user can manageIdaliases forComnents.booleanTests if this user can update syllabi.createSyllabus(SyllabusForm syllabusForm) Creates a newSyllabus.voiddeleteSyllabus(Id syllabusId) Deletes aSyllabus.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getSyllabusFormForCreate(Id courseId, Type[] syllabusRecordTypes) Gets the syllabus form for creating new syllabi.getSyllabusFormForUpdate(Id syllabusId) Gets the syllabus form for updating an existing syllabus.voidupdateSyllabus(SyllabusForm syllabusForm) Updates an existing syllabus.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateSyllabi
boolean canCreateSyllabi()Tests if this user can create syllabi. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aSyllabuswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifSyllabuscreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateSyllabusWithRecordTypes
Tests if this user can create a singleSyllabususing the desired record types. WhileCourseSyllabusManager.getSyllabusRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificSyllabus. Providing an empty array tests if aSyllabuscan be created with no records.- Parameters:
syllabusRecordTypes- array of syllabus record types- Returns:
trueifSyllabuscreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-syllabusRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getSyllabusFormForCreate
SyllabusForm getSyllabusFormForCreate(Id courseId, Type[] syllabusRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the syllabus form for creating new syllabi. A new form should be requested for each create transaction.- Parameters:
courseId- theIdfor the coursesyllabusRecordTypes- array of syllabus record types- Returns:
- the syllabus form
- Throws:
NotFoundException-courseIdis not foundNullArgumentException-courseIdorsyllabusRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createSyllabus
Syllabus createSyllabus(SyllabusForm syllabusForm) throws NotFoundException, OperationFailedException, PermissionDeniedException Creates a newSyllabus.- Parameters:
syllabusForm- the form for thisSyllabus- Returns:
- the new
Syllabus - Throws:
IllegalStateException-syllabusFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNotFoundException-courseIdis not foundNullArgumentException-syllabusFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-syllabusFormdid not originate fromgetSyllabusFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateSyllabi
boolean canUpdateSyllabi()Tests if this user can update syllabi. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aSyllabuswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifSyllabusmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getSyllabusFormForUpdate
SyllabusForm getSyllabusFormForUpdate(Id syllabusId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the syllabus form for updating an existing syllabus. A new syllabus form should be requested for each update transaction.- Parameters:
syllabusId- theIdof theSyllabus- Returns:
- the syllabus form
- Throws:
NotFoundException-syllabusIdis not foundNullArgumentException-syllabusIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSyllabus
void updateSyllabus(SyllabusForm syllabusForm) throws OperationFailedException, PermissionDeniedException Updates an existing syllabus.- Parameters:
syllabusForm- the form containing the elements to be updated- Throws:
IllegalStateException-syllabusFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-syllabusFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-syllabusFormdid not originate fromgetSyllabusFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteSyllabi
boolean canDeleteSyllabi()Tests if this user can delete syllabi. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aSyllabuswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifSyllabusdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteSyllabus
void deleteSyllabus(Id syllabusId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aSyllabus.- Parameters:
syllabusId- theIdof theSyllabusto remove- Throws:
NotFoundException-syllabusIdnot foundNullArgumentException-syllabusIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageSyllabusAliases
boolean canManageSyllabusAliases()Tests if this user can manageIdaliases forComnents. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifSyllabusaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasSyllabus
void aliasSyllabus(Id syllabusId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aSyllabusfor the purpose of creating compatibility. The primaryIdof theSyllabusis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another syllabus, it is reassigned to the given syllabusId.- Parameters:
syllabusId- theIdof aSyllabusaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-syllabusIdnot foundNullArgumentException-syllabusIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-