The plug-in interface for IReplaceSemesterHandler is used by IPSIS adapters to support the replace operation for Semesters.
The interface implementation D2L.IM.IPSIS.OrgUnits.Semesters.Handlers.IReplaceSemesterHandler.
The following configuration list provides a starting point for any IPSIS implementation:
Template - Semester, IPSIS
- ReplaceSemesterReadHandler (Sort Order = 10)
- ReplaceSemesterValidateHandler (Sort Order = 20)
- ReplaceSemesterCreateLMSHandler (Sort Order = 30)
- ReplaceSemesterCreateIMHandler (Sort Order = 40)
- ReplaceSemesterSaveLMSHandler (Sort Order = 50)
- ReplaceSemesterSaveIMHandler (Sort Order = 60)
ReplaceSemesterReadHandler
The ReplaceSemesterReadHandler reads all information related to the Semester that exists in the LMS or IM Tables of the database to be used in further handlers.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterReadHandler
Expected behavior
The handler performs the following tasks:
- Attempts to read information about the Semester from the IM tables. If the information is found, the handler attempts to read any mappings to the LMS for the Semester and attempts to read about the Semester from the LMS.
- Attempts to read information about any indicated parent OrgUnits from the IM tables, if none are found, the handler sets the default parent list of the Organization at the only parent.
- 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
A Read handler should occur before Validate handlers.
ReplaceSemesterValidateHandler
The ReplaceSemesterValidateHandler ensures that a Valid Code and Name are assigned to the Semester.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterValidateHandler
Expected behavior
The Validate handler checks to ensure that both a Code and Name were specified for the request. These values must be strings of length greater than 0. The handler performs the following tasks:
- If either the Code or the Name are null or empty, the handler throws an ArgumentNullException and all handler processing stops.
- The validate handler also checks to make sure that the request isn't trying to change the type (e.g., change a College to a Department) of an existing org unit. If the request is trying to change the type an InvalidOperationException is thrown and all handler processing stops.
- If everything is successful, 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
Validate handlers should be configured before the Create handler.
ReplaceSemesterCreateLMSHandler
The ReplaceSemesterCreateLMSHandler creates the Semester in the Brightspace.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterCreateLMSHandler
Expected behavior
This handler only runs if there are no Brightspace Semesters associated with the request. The handler performs the following tasks:
- Creates the LMS Semester using the information passed in the request (triggering automatic Create Semester audit logging).
- If everything is successful, the handler sets the status of the result to EntityCreated.
- If there is an error, the handler sets the status of the result to CreateFailed.
- 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 notes
- This handler should be placed after any Validate handlers.
- The Create LMS handler should occur before the Create IM handler.
ReplaceSemesterCreateIMHandler
The ReplaceSemesterCreateIMHandler creates the Entity in the IM tables, and a mapping if one is defined.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterCreateIMHandler
Expected behavior
This handler only runs if there is no matching Entity in the IM tables. The handler performs the following tasks:
- Creates the Semester in the IM Platform.
- If there is an LMS OrgUnit associated with the request, the handler creates the IM Platform Semester Mapping to the LMS Semester.
- If everything is successful, the handler sets the status of the result to EntityCreated.
- 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 handler would be placed after any CreateLMS handlers.
ReplaceSemesterSaveLMSHandler
The save handler saves any changes that have been made to the LMS Semester.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterSaveLMSHandler
Expected behavior
This handler only runs if there are changes to be saved for the LMS Semester. The handler performs the following tasks:
- Updates the LMS Semester (triggering automatic audit logging).
- If the request is an update, and at least one field was modified, then the handler sets the status of the result to EntityUpdated.
- 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 handler would be placed after any Create handlers.
ReplaceSemesterSaveIMHandler
The save handler saves any changes that have been made to IM Entity and Mappings.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semester.Handlers.ReplaceSemesterSaveIMHandler
Expected behavior
This handler only runs if there are changes to be saved for the Entity or Hierarchy in the IM tables. The handler performs the following tasks:
- Updates the IM Entity if there are pending changes.
- Updates the IM Entity's Hierarchy relationships if parents were added or removed.
- 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 handler would be placed after any SaveLMS handlers.
ReplaceSemesterMapByCodeHandler
The ReplaceSemesterMapByCodeHandler associates a Semester with an existing LMS Semester by matching on OrgUnitCode.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterMapByCodeHandler
Expected behavior
The handler performs the following tasks:
- If there is no Semester Mapping, the handler attempts to find a Semester in the LMS that matches on OrgUnitCode
- If a match is found, the handler updates the request object to contain the matched orgUnit. The handler should only be used if the Org Unit Code is expected to be unique within an Org.
- Proceeds to next handler.
Error behavior
If there is a problem during processing, an exception is thrown, along with as much detailed information as possible.
Configuration note
This handler is typically placed between the Read handlers and the Create handlers, in which case it will only execute if the Read handlers fail to find a mapped Semester.
ReplaceSemesterNameNoUpdateLMSHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterNoUpdateLMSHandler
Expected behavior
The handler performs the following tasks:
- Update the request object to indicate that the Name should not be updated.
- 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 handler should be placed before any SaveLMS handlers.
ReplaceSemesterValidateLMSOrgUnitExistsHandler
The ReplaceSemesterValidateLMSOrgUnitExistsHandler checks to see if the org unit that the request corresponds to has been deleted in the LMS.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.Semesters.Handlers.ReplaceSemesterValidateLMSOrgUnitExistsHandler
Expected behavior
The handler performs the following tasks:
- Tries to get the current org unit.
- If the current org unit does not exist (either the request is a create, or the org unit was deleted from the LMS), the handler tries to get the ExternalOrgUnitInfo for the request.
- If the ExternalOrgUnitInfo is valid, then this isn't a create, and the org unit was deleted from the LMS. The handler throws a UpdateOrgUnitFailedException. This exception causes the LIS Service to respond with invaliddata.
Error behavior
If there is a problem during processing, an exception is thrown, along with as much detailed information as possible.
Configuration note
This handler is placed after the read handlers, usually as one of the first validate handlers.