The plug-in interface for IDeleteCourseTemplateHandler is used by IPSIS Adapters to delete course templates from Brightspace.
The interface implementation is D2L.IM.IPSIS.OrgUnits.CourseTemplates.Handlers.IDeleteCourseTemplateHandler.
The IPSIS, Template - Course Template configuration lists for the IDeleteCourseTemplateHandler interface are shipped with the product. They are listed along with the extension point they are intended for.
The following handlers are used as a starting point:
- DeleteCourseTemplateValidateHandler (Sort Order = 10)
- DeleteCourseTemplateIMHandler (Sort Order = 20)
DeleteCourseTemplateIMHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseOfferings.Handlers.DeleteCourseTemplateIMHandler
Expected behavior
The handler performs the following tasks:
- If there is anything dependent on the course template (IM Hierarchy children) the process fails.
- The handler does a soft-delete of the course template from the IPSIS tables.
- Deletes any IM Hierarchy parent entries that reference the template.
- Processing continues to the next configured handler.
Error behavior
If there is a problem during processing, an exception is thrown, along with as much detailed information as possible.
Configuration note
The Delete IM handler should typically be run last in the list of handlers.
DeleteCourseTemplateDeleteLEHandler
The DeleteCourseTemplateDeleteLEHandler is used if the desired behavior is to have all mapped Brightspace templates deleted if they have no children in Brightspace.
Expected behavior
For each mapped course template, the handler performs the following tasks:
- Deletes the course template (automatically creating an audit entry).
- Marks any mappings in the IM tables to the deleted Brightspace item as deleted.
- Processing continues to the next handler (Return True).
Error behavior
If there is a problem during processing, an exception is thrown, along with as much detailed information as possible.
Configuration note
This must occur before the IM table delete (example: DeleteCourseTemplateIMHandler).
DeleteCourseTemplateCascadeDeleteCourseOfferingHandler
The DeleteCourseTemplateCascadeDeleteCourseOfferingHandler is used to cascade the delete to any course offering children that still exist.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseTemplates.Handlers.DeleteCourseTemplateCascadeDeleteCourseOfferingHandler
Expected behavior
The handler performs the following tasks:
- For each remaining course offering referencing the template in the IM Hierarchies table, the handlers configured for IDeleteCourseOffering are used to delete the course offerings.
- Processing continues to the next handler (Return True).
Error behavior
If there is a problem during processing, an exception is thrown, along with as much detailed information as possible.
Configuration note
This must occur before the OrgUnit is deleted from either the IM or the Brightspace tables (for example: DeleteCourseTemplateIMHandler and DeleteCourseTemplateDeleteLEHandler).
DeleteCourseTemplateValidateHandler
The DeleteCourseTemplateValidateHandler should always be used. It performs input validation that is needed to ensure that all the other Delete handlers perform properly.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseTemplates.Handlers.DeleteCourseTemplateValidateHandler
Expected behavior
The handler performs the following tasks:
- Checks that the SIS Id on the request corresponds to a real item in the IM tables.
- Checks that the OrgUnit Type that the service expects matches the Type of the orgUnit in the database.
- If all checks pass, the handler saves the ExternalOrgUnitInfo on the request for later handlers to use.
Error behavior
If any part of the validation fails, an exception is thrown, along with as much detailed information as possible.
Configuration note
The Validate handler should typically be run first in the list of handlers, before any handler that updates or deletes information from the database.