Search in sources :

Example 11 with EPStructureChangeEvent

use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project openolat by klemens.

the class EPCollectStepForm04 method formOK.

/**
 * @see org.olat.core.gui.control.generic.wizard.StepFormBasicController#formOK(org.olat.core.gui.UserRequest)
 */
@Override
protected void formOK(UserRequest ureq) {
    PortfolioStructure selectedPortfolioStructure = preSelectedStructure;
    TreeNode node = mapsTreeController == null ? null : mapsTreeController.getSelectedNode();
    if (node != null) {
        Object obj = node.getUserObject();
        if (obj == null) {
            selectedPortfolioStructure = null;
        } else if (obj instanceof PortfolioStructure && !(obj instanceof EPAbstractMap)) {
            selectedPortfolioStructure = (PortfolioStructure) obj;
        }
    }
    if (selectedPortfolioStructure != null) {
        ePFMgr.setUsersLastUsedPortfolioStructure(getIdentity(), selectedPortfolioStructure);
    }
    if (isUsedInStepWizzard()) {
        addToRunContext("selectedStructure", selectedPortfolioStructure);
        fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
    } else {
        if (selectedPortfolioStructure != null && !selectedPortfolioStructure.getKey().equals(oldStructure.getKey())) {
            ePFMgr.moveArtefactFromStructToStruct(artefact, oldStructure, selectedPortfolioStructure);
            // refresh ui
            fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.CHANGED, selectedPortfolioStructure));
        }
    }
}
Also used : EPAbstractMap(org.olat.portfolio.model.structel.EPAbstractMap) TreeNode(org.olat.core.gui.components.tree.TreeNode) PortfolioStructure(org.olat.portfolio.model.structel.PortfolioStructure) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Example 12 with EPStructureChangeEvent

use of org.olat.portfolio.ui.structel.EPStructureChangeEvent in project openolat by klemens.

the class EPReflexionWrapperController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == reflexionCtrl && event instanceof EPReflexionChangeEvent) {
        EPReflexionChangeEvent refEv = (EPReflexionChangeEvent) event;
        if (struct != null) {
            ePFMgr.setReflexionForArtefactToStructureLink(refEv.getRefArtefact(), struct, refEv.getReflexion());
            reflexionBox.deactivate();
            fireEvent(ureq, new EPStructureChangeEvent(EPStructureChangeEvent.ADDED, struct));
        } else {
            AbstractArtefact refArtefact = refEv.getRefArtefact();
            refArtefact.setReflexion(refEv.getReflexion());
            ePFMgr.updateArtefact(refArtefact);
            reflexionBox.deactivate();
            fireEvent(ureq, Event.DONE_EVENT);
        }
        removeAsListenerAndDispose(reflexionBox);
    } else if (source == reflexionBox && event == CloseableCalloutWindowController.CLOSE_WINDOW_EVENT) {
        removeAsListenerAndDispose(reflexionBox);
        reflexionBox = null;
    }
}
Also used : AbstractArtefact(org.olat.portfolio.model.artefacts.AbstractArtefact) EPReflexionChangeEvent(org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent) EPStructureChangeEvent(org.olat.portfolio.ui.structel.EPStructureChangeEvent)

Aggregations

EPStructureChangeEvent (org.olat.portfolio.ui.structel.EPStructureChangeEvent)12 PortfolioStructure (org.olat.portfolio.model.structel.PortfolioStructure)8 AbstractArtefact (org.olat.portfolio.model.artefacts.AbstractArtefact)6 TreeNode (org.olat.core.gui.components.tree.TreeNode)4 EPReflexionWrapperController (org.olat.portfolio.ui.artefacts.edit.EPReflexionWrapperController)4 ArrayList (java.util.ArrayList)2 BitSet (java.util.BitSet)2 List (java.util.List)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)2 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)2 TreeDropEvent (org.olat.core.gui.components.tree.TreeDropEvent)2 TreeEvent (org.olat.core.gui.components.tree.TreeEvent)2 Event (org.olat.core.gui.control.Event)2 EPAbstractMap (org.olat.portfolio.model.structel.EPAbstractMap)2 EPReflexionChangeEvent (org.olat.portfolio.ui.artefacts.collect.EPReflexionChangeEvent)2 EPTagsController (org.olat.portfolio.ui.artefacts.edit.EPTagsController)2 EPArtefactClicked (org.olat.portfolio.ui.structel.EPArtefactClicked)2