示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
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)
示例#5
0
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)