The plug-in interface for IReplaceCourseSectionHandler is used by IPSIS adapters to support the replace operation for course sections.
The interface implementation is D2L.IM.IPSIS.OrgUnits.CourseSections.Handlers.IReplaceCourseSectionHandler.
The IPSIS, Template - Sections and IPSIS, Template - Groups configuration lists provide a starting point for any IPSIS implementation.
The following handler list is used as a starting point when you want to use Brightspace Course Sections for your SIS Sections:
- ReplaceCourseSectionReadHandler (Sort Order = 10)
- ReplaceCourseSectionStatusDefaultActiveHandler (Sort Order = 20)
- ReplaceCourseSectionParentDepartmentParentSemesterDefaultNoneHandler (Sort Order = 30)
- ReplaceCourseSectionValidateBaseHandler (Sort Order = 40)
- ReplaceCourseSectionValidateParentOfferingExistsHandler (Sort Order = 50)
- ReplaceCourseSectionCreateLMSSectionHandler (Sort Order = 60)
- ReplaceCourseSectionCreateIMSectionHandler (Sort Order = 70)
- ReplaceCourseSectionSaveLMSSectionHandler (Sort Order = 80)
- ReplaceCourseSectionSaveIMHandler (Sort Order = 90)
The following handler list is used as a starting point when you want to use Brightspace Groups for your SIS Sections:
- ReplaceCourseSectionReadHandler (Sort Order = 10)
- ReplaceCourseSectionStatusDefaultActiveHandler (Sort Order = 20)
- ReplaceCourseSectionParentDepartmentParentSemesterDefaultNoneHandler (Sort Order = 30)
- ReplaceCourseSectionValidateBaseHandler (Sort Order = 40)
- ReplaceCourseSectionValidateParentOfferingExistsHandler (Sort Order = 50)
- ReplaceCourseSectionCreateLMSGroupHandler (Sort Order = 60)
- ReplaceCourseSectionCreateIMSectionHandler (Sort Order = 70)
- ReplaceCourseSectionSaveLMSGroupHandler (Sort Order = 80)
- ReplaceCourseSectionSaveIMHandler (Sort Order = 90)
ReplaceCourseSectionReadHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionReadHandler
Expected behavior
The handler performs the following tasks:
- Attempts to read information about the course section from the IM tables.
- If found, the handler attempts to read any mappings to Brightspace for the course section and attempts to read about the course section from Brightspace.
- For each parent org unit specified in the request, the handler reads the information from Brightspace and adds it to Parent OrgUnits list. If the parent has no mappings to Brightspace, the handler throws a ParentNotFoundException.
- Processing proceeds to next handler.
ReplaceCourseSectionStatusDefaultActiveHandler
Implementation
ReplaceCourseSectionStatusDefaultActiveHandler
Expected behavior
The handler performs the following tasks:
- Sets the status of the course section object to active if it doesn't already have a value.
- Processing proceeds to the next handler.
ReplaceCourseSectionParentDepartmentParentSemesterDefaultNoneHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionParentDepartmentParentSemesterDefaultNoneHandler
Expected behavior
The handler performs the following tasks:
- Removes the parent department and/or parent semester from the request.
- Removes ParentOrgUnits if either of them are set in the adapter. These values are not used in the default implementation.
- Processing proceeds to the next handler.
ReplaceCourseSectionValidateBaseHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionValidateBaseHandler
Expected behavior
The handler performs the following actions:
- Checks to ensure that both a code and name value are specified for the request. These values must be strings of length greater than 0. If either the code or the name are null or empty, then the Validate handler throws an ArgumentNullException.
- If the section already exists in the IM tables, the handler checks that any parent OrgUnits specified on the request already exist as parents in the IM hierarchy. If an attempt was made to add or replace a parent of the section, then an exception is thrown. The error message is: Unable to change the parent offering of course section with id {id}. This behavior is not supported.
- Processing proceeds to the next handler.
ReplaceCourseSectionValidateParentOfferingExistsHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionValidateParentOfferingExistsHandler
Expected behavior
The handler performs the following actions:
- Checks to ensure that the specified parent offering exists in both the Brightspace OrgUnit and the IPSIS OrgUnit.
- If there is an association between the two, the handler ensures that the association is valid.
- If any of the checks fail, the Validate handler throws a ParentNotFoundException. The exception is caught, logged and handled in the manager.
- Processing continues to the next handler.
ReplaceCourseSectionNameNoUpdateLMSHandler
The ReplaceCourseSectionNameNoUpdateLMSHandler is used to prevent updates to the name of the Brightspace Group/Section after initial creation.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionNameNoUpdateLMSHandler
Expected behavior
The handler performs the following actions:
- Updates the request object to indicate that the name should not be updated.
- Processing continues to the next handler.
Configuration note
This handler is a Manipulate handler intended to be configured before the LMS Create and LMS Save handlers.
ReplaceCourseSectionCreateLMSSectionHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionCreateLMSSectionHandler
Expected behavior
This handler is only run if the section does not yet exist in both the IM and the Brightspace tables. The handler performs the following actions:
- Creates the course section using the information passed in the request (triggering a Create Section audit entry).
- If LMS Create is successful, the handler generates a Created Course Section Audit entry, referencing the Course Section Id.
- If the Create is not successful, the handler sets ReplaceRequestStatus = CreateFailed and all handler processing stops (Return False).
- If everything is successful, the handler sets ReplaceRequestStatus = EntityCreated and processing continues to the next handler (Return True).
ReplaceCourseSectionCreateIMSectionHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionCreateIMSectionHandler
Expected behavior
The handler performs the following actions:
- Creates the IPSIS OrgUnit if it doesn't already exist.
- Adds the appropriate IM Hierarchy.
- For each Org Unit it is mapped to, the handler creates the IPSIS mapping if it doesn't already exist. If successful, the handler sets the ReplaceRequestStatus to EntityCreated, and returns true. If a failure occurs, then the ReplaceRequestStatus is set to CreateFailed, and the handler returns false.
- Processing continues to the next handler.
ReplaceCourseSectionSaveLMSSectionHandler
The ReplaceCourseSectionSaveLMSSectionHandler saves changes to all mapped Brightspace sections (zero or more) if required.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionSaveLMSSectionHandler
Expected behavior
For each mapped section, if there are any updates to take place, the handler performs the following actions:
- Updates the section (Triggering an Update Section Audit entry).
- Updates the OrgUnit properties in Brightspace but does not alter the parents of the section.
- If LMS Update is successful, the handler generates an Updated Course Section Audit entry, referencing the Course SectionId.
- If everything is not successful, the handler sets ReplaceRequestStatus = CreateFailed and all handler processing stops (Return False).
- If everything is successful, the handler sets ReplaceRequestStatus = EntityCreated and processing continues to the next handler (Return True).
ReplaceCourseSectionSaveIMHandler
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionSaveIMHandler
Expected behavior
The handler performs the following actions:
- Saves any changes to the IPSIS course section and associations if required.
- Saves any changes to the IM Hierarchy.
ReplaceCourseSectionCreateLMSGroupHandler
The ReplaceCourseSectionCreateLMSGroupHandler when an organization wishes to create groups instead of sections in Brightspace.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionCreateLMSGroupHandler
Expected behavior
This handler is only run if the group does not yet exist in both the IM and Brightspace tables. The handler performs the following actions:
- Gets the value in d2l.integration.IPSIS.GroupCategory. If the value is not set, the handler throws an InvalidConfigurationVariableException.
- If a group category matching the name in d2l.integration.IPSIS.GroupCategory does not exist, the handler creates a group category with a name and description from the config variable (triggering a create group audit entry).
- If group category creation is not successful, the handler throws an exception with an explicit indication of the problem and section identifier.
- Creates the course group with the above group category using the information passed in the request.
- If the LMS Create is successful, the handler generates a Created Course Group Audit entry, referencing the Course Group Id.
- If everything is not successful, the handler sets ReplaceRequestStatus = CreateFailed and all handler processing stops (Return False).
- If everything is successful, the handler sets ReplaceRequestStatus = EntityCreated, and processing continues to the next handler (Return True).
Configuration note
This handler replaces the ReplaceCourseSectionCreateLMSSectionHandler in the default plug-in list.
ReplaceCourseSectionSaveLMSGroupHandler
The ReplaceCourseSectionSaveLMSGroupHandler is used when an organization wishes to create groups instead of sections in the LMS.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionSaveLMSGroupHandler
Expected behavior
For each mapped Brightspace group, if there are any updates to take place, the handler performs the following actions:
- Updates the group (triggering an Update Group audit entry) and updates the OrgUnit properties in Brightspace, but does not alter the parents of the group.
- If the LMS Update is successful, the handler generates an Updated Course Group Audit entry, referencing the Course Group Id.
- If everything is not successful, the handler sets ReplaceRequestStatus = CreateFailed and all handler processing stops (Return False).
- If everything is successful, the handler sets ReplaceRequestStatus = EntityCreated and processing continues to the next handler (Return True).
Configuration note
This handler replaces the ReplaceCourseSectionSaveLMSSectionHandler in the default plug-in list.
ReplaceCourseSectionValidateLMSOrgUnitExistsHandler
The ReplaceCourseSectionValidateLMSOrgUnitExistsHandler checks to see if the org unit that the request corresponds to has been deleted in Brightspace.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionValidateLMSOrgUnitExistsHandler
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 Brightspace, 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 Brightspace and an UpdateOrgUnitFailedException is thrown. This exception causes the LIS Service to respond with invaliddata. This was deemed to be the most suitable response code for this situation.
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.
ReplaceCourseSectionBuildParentHierarchyRequiredHandler
The ReplaceCourseSectionBuildParentHierarchyRequiredHandler builds out a parent offering and template for the section if none were passed in on the request.
Implementation
D2L.IM.IPSIS.Default.OrgUnits.CourseSections.Handlers.ReplaceCourseSectionBuildParentHierarchyRequiredHandler
Expected behavior
The handler performs the following actions:
- Checks to see if a parent offering was specified on the request.
- If not, then the handler creates a parent offering and parent template, both of which have the same name and code as the section.
- Returns true.
Error behavior
If there is a problem creating either the template or the offering, a CreateOrgUnitFailedException is thrown.
Configuration note
This handler must be placed before any Validate handlers, usually right after the read handler.