/**
* life cycle of node data e.g properties stuff should be deleted if node gets
* deleted life cycle: create - delete - migrate
*/
public void cleanupOnDelete(ICourse course) {
DialogElementsPropertyManager depm = DialogElementsPropertyManager.getInstance();
//remove all possible forum subscriptions
DialogPropertyElements findDialogElements = depm.findDialogElements(course.getResourceableId(), getIdent());
if(findDialogElements != null){
List<DialogElement> dialogElments = findDialogElements.getDialogPropertyElements();
for (DialogElement dialogElement : dialogElments) {
Long forumKey = dialogElement.getForumKey();
SubscriptionContext subsContext = CourseModule.createSubscriptionContext(course.getCourseEnvironment(), this, forumKey.toString());
NotificationsManager.getInstance().delete(subsContext);
//also delete forum -> was archived in archiveNodeData step
ForumManager.getInstance().deleteForum(forumKey);
}
}
//delete property
depm.deleteProperty(course.getResourceableId(), this.getIdent());
}