def lectureModified(obj, event=None): portal_workflow = getToolByName(obj, "portal_workflow") logger.debug("lecture %s modified" % obj.id) status = portal_workflow.getStatusOf("simple_publication_workflow", obj) if status and status.get("review_state", None) == "published": dbLec = syncPloneLecture(obj) syncPloneQuestions(dbLec, obj) else: removePloneLecture(obj)
def registryUpdated(obj, event=None): logger.debug("registry object updated") for l in _childrenOfType(getSite(), "tw_lecture"): # Make sure lectures inheriting settings are up-to-date syncPloneLecture(l)
def questionRemoved(obj, event): logger.debug("question %s removed" % obj.id) # NB: Ideally we just sync the questions, but need the dbLec anyway if event.oldParent.portal_type == 'tw_lecture': syncPloneQuestions(syncPloneLecture(event.oldParent), event.oldParent)
def questionModified(obj, event=None): logger.debug("question %s modified" % obj.id) # NB: Ideally we just sync the questions, but need the dbLec anyway syncPloneQuestions(syncPloneLecture(obj.aq_parent), obj.aq_parent)
def tutorialModified(obj, event=None): logger.debug("tutorial %s modified" % obj.id) for l in _childrenOfType(obj, "tw_lecture"): # Make sure lectures inheriting settings are up-to-date syncPloneLecture(l)