Package org.olat.course.nodes.projectbroker.datamodel

Examples of org.olat.course.nodes.projectbroker.datamodel.ProjectBroker


   *      org.olat.course.ICourse, org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.WindowControl)
   */
  @Override
  public Controller importNode(File importDirectory, ICourse course, boolean unattendedImport, UserRequest ureq, WindowControl wControl) {
    ProjectBroker projectBroker = ProjectBrokerManagerFactory.getProjectBrokerManager().createAndSaveProjectBroker();
    CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    ProjectBrokerManagerFactory.getProjectBrokerManager().saveProjectBrokerId(projectBroker.getKey(), cpm, this);
   
    return null;
  }
View Full Code Here


      rstart = System.currentTimeMillis();
    }
    OLATResourceable projectBrokerOres = OresHelper.createOLATResourceableInstance(this.getClass(),projectBrokerId);
    List<Project> projectList = CoordinatorManager.getCoordinator().getSyncer().doInSync( projectBrokerOres, new SyncerCallback<List<Project>>() {
      public List<Project> execute() {
        ProjectBroker projectBroker = getOrLoadProjectBoker(projectBrokerId);
        return projectBroker.getProjects();     
      }

    });
 
    if(log.isDebug()){
View Full Code Here

    }
    return projectList;
  }

  public ProjectBroker createAndSaveProjectBroker() {
    ProjectBroker projectBroker = new ProjectBrokerImpl();
    DBFactory.getInstance().saveObject(projectBroker);
    return projectBroker;
  }
View Full Code Here

    OLATResourceable projectBrokerOres = OresHelper.createOLATResourceableInstance(this.getClass(),projectBrokerId);
    final Project project = new ProjectImpl(title, description, projectGroup, getProjectBroker(projectBrokerId));
    CoordinatorManager.getCoordinator().getSyncer().doInSync( projectBrokerOres, new SyncerExecutor() {
      public void execute() {
        DBFactory.getInstance().saveObject(project);
        ProjectBroker projectBroker = getOrLoadProjectBoker(projectBrokerId);
        projectBroker.getProjects().add(project);
        projectCache.update(projectBrokerId.toString(), projectBroker);
      }
    })
    return project;
  }
View Full Code Here

          deleteAllReturnboxFilesOfProject(project, courseEnv, cNode);
        }
        DBFactory.getInstance().deleteObject(project);
        log.info("deleteSecurityGroup(project.getCandidateGroup())=" + candidateGroup.getKey());
        ManagerFactory.getManager().deleteSecurityGroup(candidateGroup);
        ProjectBroker projectBroker = getOrLoadProjectBoker(projectBrokerId);
        projectBroker.getProjects().remove(project);
        projectCache.update(projectBrokerId.toString(), projectBroker);
      }
    });
    if (deleteGroup) {
      log.debug("start deleteProjectGroupFor project=" + project);
View Full Code Here

 
  public void signOutFormAllCandidateList(final List<Identity> chosenIdentities, final Long projectBrokerId) {
    OLATResourceable projectBrokerOres = OresHelper.createOLATResourceableInstance(this.getClass(),projectBrokerId);
    CoordinatorManager.getCoordinator().getSyncer().doInSync( projectBrokerOres, new SyncerExecutor() {
      public void execute() {
        ProjectBroker projectBroker = getOrLoadProjectBoker(projectBrokerId);
        for (Iterator iterator = projectBroker.getProjects().iterator(); iterator.hasNext();) {
          Project project = (Project) iterator.next();
          // loop over all identities
          for (Iterator iterator2 = chosenIdentities.iterator(); iterator2.hasNext();) {
            Identity identity = (Identity) iterator2.next();
            ManagerFactory.getManager().removeIdentityFromSecurityGroup(identity, project.getCandidateGroup());
View Full Code Here

    }
  }

  public void deleteProjectBroker(Long projectBrokerId, CourseEnvironment courseEnvironment, CourseNode courseNode) {
    log.debug("Start deleting projectBrokerId=" + projectBrokerId );
    ProjectBroker projectBroker = getOrLoadProjectBoker(projectBrokerId);
    // delete all projects of a project-broker
    List<Project> deleteProjectList = new ArrayList<Project>();
    deleteProjectList.addAll(projectBroker.getProjects());
    for (Iterator iterator = deleteProjectList.iterator(); iterator.hasNext();) {
      Project project = (Project) iterator.next();
      deleteProject(project, true, courseEnvironment, courseNode);
      log.audit("ProjectBroker: Deleted project=" + project );
    }
View Full Code Here

  ///////////////////
  // Private Methods
  ///////////////////
  private ProjectBroker getOrLoadProjectBoker(final Long projectBrokerId) {
    // 1. check if alreday a projectBroker is in the cache
    ProjectBroker projectBroker = (ProjectBroker)projectCache.get(projectBrokerId.toString());
    if (projectBroker == null) {
      log.debug("find no projectBroker in the cache => create a new one projectBrokerId=" + projectBrokerId);
      List projectList = DBFactory.getInstance().find(
          "select project from org.olat.course.nodes.projectbroker.datamodel.ProjectImpl as project" +
          " where project.projectBroker.key = ?", projectBrokerId,  Hibernate.LONG);
      projectBroker = getProjectBroker(projectBrokerId);
      projectBroker.setProjects(projectList);
      projectCache.put(projectBrokerId.toString(), projectBroker);
    }
    return projectBroker;
  }
View Full Code Here

    // check if a project-broker exists
    CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    Long projectBrokerId = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectBrokerId(cpm, node);
    if (projectBrokerId == null) {
      // no project-broker exist => create a new one, happens only once
      ProjectBroker projectBroker = ProjectBrokerManagerFactory.getProjectBrokerManager().createAndSaveProjectBroker();
      projectBrokerId = projectBroker.getKey();
      ProjectBrokerManagerFactory.getProjectBrokerManager().saveProjectBrokerId(projectBrokerId, cpm, node);
    }
 
    // Access
    accessabilityVC = this.createVelocityContainer("edit_condition");
View Full Code Here

    contentVC.contextPut("displayTitle", ne.getCourseNode().getLongTitle());
 
    projectBrokerId = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectBrokerId(cpm, ne.getCourseNode());
    if (projectBrokerId == null) {
      // no project-broker exist => create a new one, happens only once
      ProjectBroker projectBroker = ProjectBrokerManagerFactory.getProjectBrokerManager().createAndSaveProjectBroker();
      projectBrokerId = projectBroker.getKey();
      ProjectBrokerManagerFactory.getProjectBrokerManager().saveProjectBrokerId(projectBrokerId, cpm, ne.getCourseNode());
      getLogger().info("no project-broker exist => create a new one projectBrokerId=" + projectBrokerId);
    }
   
    tableController = this.createTableController(ureq, wControl);
View Full Code Here

TOP

Related Classes of org.olat.course.nodes.projectbroker.datamodel.ProjectBroker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.