Search in sources :

Example 1 with OLATResourceableDeletedEvent

use of org.olat.core.util.resource.OLATResourceableDeletedEvent in project OpenOLAT by OpenOLAT.

the class ProjectBrokerGroupDeleteManager method deleteGroupDataFor.

@Override
public boolean deleteGroupDataFor(BusinessGroup group) {
    log.debug("deleteAllProjectGroupEntiresFor started.. group=" + group);
    List<Project> projectList = projectBrokerManager.getProjectsWith(group);
    for (Project project : projectList) {
        // no course-env, no course-node
        projectBrokerManager.deleteProject(project, false, null, null);
        ProjectBroker projectBroker = project.getProjectBroker();
        OLATResourceableDeletedEvent delEv = new OLATResourceableDeletedEvent(projectBroker);
        CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(delEv, projectBroker);
        log.debug("deleteProjectWith: group=" + group + " , project=" + project);
    }
    return true;
}
Also used : Project(org.olat.course.nodes.projectbroker.datamodel.Project) ProjectBroker(org.olat.course.nodes.projectbroker.datamodel.ProjectBroker) OLATResourceableDeletedEvent(org.olat.core.util.resource.OLATResourceableDeletedEvent)

Example 2 with OLATResourceableDeletedEvent

use of org.olat.core.util.resource.OLATResourceableDeletedEvent in project OpenOLAT by OpenOLAT.

the class ProjectDetailsPanelController method openEditController.

private void openEditController(UserRequest ureq) {
    if (projectBrokerManager.existsProject(project.getKey())) {
        OLATResourceable projectOres = OresHelper.createOLATResourceableInstance(Project.class, project.getKey());
        this.lock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(projectOres, ureq.getIdentity(), null);
        if (lock.isSuccess()) {
            editController = new ProjectEditDetailsFormController(ureq, this.getWindowControl(), project, courseEnv, courseNode, projectBrokerModuleConfiguration, newCreatedProject);
            editController.addControllerListener(this);
            editVC.put("editController", editController.getInitialComponent());
            detailsPanel.pushContent(editVC);
        } else {
            this.showInfo("info.project.already.edit", project.getTitle());
        }
    } else {
        this.showInfo("info.project.nolonger.exist", project.getTitle());
        // fire event to update project list
        ProjectBroker projectBroker = project.getProjectBroker();
        OLATResourceableDeletedEvent delEv = new OLATResourceableDeletedEvent(projectBroker);
        CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(delEv, projectBroker);
    }
}
Also used : ProjectBroker(org.olat.course.nodes.projectbroker.datamodel.ProjectBroker) OLATResourceable(org.olat.core.id.OLATResourceable) OLATResourceableDeletedEvent(org.olat.core.util.resource.OLATResourceableDeletedEvent)

Example 3 with OLATResourceableDeletedEvent

use of org.olat.core.util.resource.OLATResourceableDeletedEvent in project openolat by klemens.

the class ProjectBrokerGroupDeleteManager method deleteGroupDataFor.

@Override
public boolean deleteGroupDataFor(BusinessGroup group) {
    log.debug("deleteAllProjectGroupEntiresFor started.. group=" + group);
    List<Project> projectList = projectBrokerManager.getProjectsWith(group);
    for (Project project : projectList) {
        // no course-env, no course-node
        projectBrokerManager.deleteProject(project, false, null, null);
        ProjectBroker projectBroker = project.getProjectBroker();
        OLATResourceableDeletedEvent delEv = new OLATResourceableDeletedEvent(projectBroker);
        CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(delEv, projectBroker);
        log.debug("deleteProjectWith: group=" + group + " , project=" + project);
    }
    return true;
}
Also used : Project(org.olat.course.nodes.projectbroker.datamodel.Project) ProjectBroker(org.olat.course.nodes.projectbroker.datamodel.ProjectBroker) OLATResourceableDeletedEvent(org.olat.core.util.resource.OLATResourceableDeletedEvent)

Example 4 with OLATResourceableDeletedEvent

use of org.olat.core.util.resource.OLATResourceableDeletedEvent in project openolat by klemens.

the class ProjectDetailsPanelController method openEditController.

private void openEditController(UserRequest ureq) {
    if (projectBrokerManager.existsProject(project.getKey())) {
        OLATResourceable projectOres = OresHelper.createOLATResourceableInstance(Project.class, project.getKey());
        this.lock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(projectOres, ureq.getIdentity(), null);
        if (lock.isSuccess()) {
            editController = new ProjectEditDetailsFormController(ureq, this.getWindowControl(), project, courseEnv, courseNode, projectBrokerModuleConfiguration, newCreatedProject);
            editController.addControllerListener(this);
            editVC.put("editController", editController.getInitialComponent());
            detailsPanel.pushContent(editVC);
        } else {
            this.showInfo("info.project.already.edit", project.getTitle());
        }
    } else {
        this.showInfo("info.project.nolonger.exist", project.getTitle());
        // fire event to update project list
        ProjectBroker projectBroker = project.getProjectBroker();
        OLATResourceableDeletedEvent delEv = new OLATResourceableDeletedEvent(projectBroker);
        CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(delEv, projectBroker);
    }
}
Also used : ProjectBroker(org.olat.course.nodes.projectbroker.datamodel.ProjectBroker) OLATResourceable(org.olat.core.id.OLATResourceable) OLATResourceableDeletedEvent(org.olat.core.util.resource.OLATResourceableDeletedEvent)

Aggregations

OLATResourceableDeletedEvent (org.olat.core.util.resource.OLATResourceableDeletedEvent)4 ProjectBroker (org.olat.course.nodes.projectbroker.datamodel.ProjectBroker)4 OLATResourceable (org.olat.core.id.OLATResourceable)2 Project (org.olat.course.nodes.projectbroker.datamodel.Project)2