Search in sources :

Example 11 with BusinessGroupModifiedEvent

use of org.olat.group.ui.edit.BusinessGroupModifiedEvent in project openolat by klemens.

the class AssessmentModeCoordinationServiceImpl method event.

@Override
public void event(Event event) {
    if (event instanceof BusinessGroupModifiedEvent) {
        try {
            BusinessGroupModifiedEvent mod = (BusinessGroupModifiedEvent) event;
            if (BusinessGroupModifiedEvent.IDENTITY_ADDED_EVENT.equals(mod.getCommand())) {
                Long identityKey = mod.getAffectedIdentityKey();
                sendEventAfterMembershipChange(identityKey);
            }
        } catch (Exception e) {
            log.error("", e);
        }
    }
}
Also used : BusinessGroupModifiedEvent(org.olat.group.ui.edit.BusinessGroupModifiedEvent)

Example 12 with BusinessGroupModifiedEvent

use of org.olat.group.ui.edit.BusinessGroupModifiedEvent in project openolat by klemens.

the class ProjectGroupManagerImpl method sendGroupChangeEvent.

@Override
public void sendGroupChangeEvent(Project project, Long courseResourceableId, Identity identity) {
    ICourse course = CourseFactory.loadCourse(courseResourceableId);
    RepositoryEntry ores = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    MultiUserEvent modifiedEvent = new BusinessGroupModifiedEvent(BusinessGroupModifiedEvent.IDENTITY_ADDED_EVENT, project.getProjectGroup(), identity);
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, ores);
}
Also used : ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) MultiUserEvent(org.olat.core.util.event.MultiUserEvent) BusinessGroupModifiedEvent(org.olat.group.ui.edit.BusinessGroupModifiedEvent)

Example 13 with BusinessGroupModifiedEvent

use of org.olat.group.ui.edit.BusinessGroupModifiedEvent in project openolat by klemens.

the class GroupsPortletRunController method event.

public void event(Event event) {
    if (event instanceof BusinessGroupModifiedEvent) {
        BusinessGroupModifiedEvent mev = (BusinessGroupModifiedEvent) event;
        if (BusinessGroupModifiedEvent.IDENTITY_REMOVED_EVENT.equals(event.getCommand()) && getIdentity().getKey().equals(mev.getAffectedIdentityKey())) {
            Long modifiedKey = mev.getModifiedGroupKey();
            for (PortletEntry<BusinessGroupEntry> portlet : groupListModel.getObjects()) {
                if (modifiedKey.equals(portlet.getKey())) {
                    ;
                    groupListModel.getObjects().remove(portlet);
                    tableCtr.modelChanged();
                    break;
                }
            }
        }
    }
}
Also used : BusinessGroupModifiedEvent(org.olat.group.ui.edit.BusinessGroupModifiedEvent)

Example 14 with BusinessGroupModifiedEvent

use of org.olat.group.ui.edit.BusinessGroupModifiedEvent in project openolat by klemens.

the class BusinessGroupMainRunController method event.

/**
 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
 */
@Override
public void event(Event event) {
    if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
        OLATResourceableJustBeforeDeletedEvent delEvent = (OLATResourceableJustBeforeDeletedEvent) event;
        if (!delEvent.targetEquals(businessGroup)) {
            throw new AssertException("receiving a delete event for a olatres we never registered for!!!:" + delEvent.getDerivedOres());
        }
        dispose();
    } else if (event instanceof BusinessGroupModifiedEvent) {
        BusinessGroupModifiedEvent bgmfe = (BusinessGroupModifiedEvent) event;
        if (event.getCommand().equals(BusinessGroupModifiedEvent.CONFIGURATION_MODIFIED_EVENT)) {
            // reset business group property manager
            // update reference to update business group object
            businessGroup = businessGroupService.loadBusinessGroup(businessGroup);
            chatAvailable = isChatAvailable();
            main.contextPut("BuddyGroup", businessGroup);
            TreeModel trMdl = buildTreeModel();
            bgTree.setTreeModel(trMdl);
            if (bgEditCntrllr == null) {
                // change didn't origin by our own edit controller
                showInfo("grouprun.configurationchanged");
                bgTree.setSelectedNodeId(trMdl.getRootNode().getIdent());
                mainPanel.setContent(main);
            } else {
                // Activate edit menu item
                bgTree.setSelectedNodeId(ACTIVITY_MENUSELECT_ADMINISTRATION);
            }
        } else if (bgmfe.wasMyselfRemoved(getIdentity()) && !wildcard && !isGroupsAdmin) {
            // nothing more here!! The message will be created and displayed upon disposing
            // disposed message controller will be set
            dispose();
        }
    } else if (event instanceof AssessmentEvent) {
        if (((AssessmentEvent) event).getEventType().equals(AssessmentEvent.TYPE.STARTED)) {
            groupRunDisabled = true;
        } else if (((AssessmentEvent) event).getEventType().equals(AssessmentEvent.TYPE.STOPPED)) {
            groupRunDisabled = false;
        }
    }
}
Also used : TreeModel(org.olat.core.gui.components.tree.TreeModel) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) AssertException(org.olat.core.logging.AssertException) AssessmentEvent(org.olat.course.nodes.iq.AssessmentEvent) OLATResourceableJustBeforeDeletedEvent(org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent) BusinessGroupModifiedEvent(org.olat.group.ui.edit.BusinessGroupModifiedEvent)

Aggregations

BusinessGroupModifiedEvent (org.olat.group.ui.edit.BusinessGroupModifiedEvent)14 BusinessGroup (org.olat.group.BusinessGroup)4 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Test (org.junit.Test)2 PublisherData (org.olat.core.commons.services.notifications.PublisherData)2 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)2 OlatCmdEvent (org.olat.core.gui.components.htmlsite.OlatCmdEvent)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)2 TreeModel (org.olat.core.gui.components.tree.TreeModel)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 Identity (org.olat.core.id.Identity)2 AssertException (org.olat.core.logging.AssertException)2 MultiUserEvent (org.olat.core.util.event.MultiUserEvent)2 OLATResourceableJustBeforeDeletedEvent (org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent)2 ICourse (org.olat.course.ICourse)2 CourseNode (org.olat.course.nodes.CourseNode)2 AssessmentEvent (org.olat.course.nodes.iq.AssessmentEvent)2 TreeNodeEvent (org.olat.modules.cp.TreeNodeEvent)2