Examples of Grouping


Examples of net.sf.collabreview.core.Grouping

   * If the Grouping exists it is deleted and all contents are set obsolete.
   *
   * @param actionData detail information of the update
   */
  private void delete(ActionData actionData) {
    Grouping target = repository.getGrouping(actionData.getSourcePath());
    if (target != null) {
      logger.debug("Deleting Grouping: " + target.getName());
      final Date date = actionData.getDate();
      target.visitAllArtifacts(new Grouping.ArtifactVisitListener() {
        public void visit(Grouping grouping, ArtifactIdentifier aid) {
          Artifact obsArt = repository.getArtifact(aid);
          obsArt.setObsoleteDate(date);
          grouping.removeArtifact(obsArt);
        }
      });
      Grouping deleted = repository.removeGrouping(actionData.getSourcePath());
      assert deleted != null;
    }
  }
View Full Code Here

Examples of net.sf.collabreview.core.Grouping

    final String copiedFrom = actionData.getSourceCopyPath();
    if (copiedFrom == null) {
      return;
    }
    importProgressInfo.setAtomicWorkUnitDescription("Copying all artifacts from " + copiedFrom);
    Grouping origin = repository.getGrouping(copiedFrom);
    if (origin == null) {
      logger.warn("No origin grouping to copy from: " + copiedFrom);
      return;
    }
    // ... if yes, copy all Artifacts to the new Grouping
    origin.visitAllArtifacts(new Grouping.ArtifactVisitListener() {
      public void visit(Grouping grouping, ArtifactIdentifier aid) {
        rebranch(grouping, copiedFrom, aid, actionData);
      }
    });
  }
View Full Code Here

Examples of net.sf.collabreview.core.Grouping

   *
   * @param actionData the ActionData object on behalf of which the update is done
   */
  private void update(final ActionData actionData) {
    // find the Grouping
    Grouping target = repository.getGrouping(actionData.getSourcePath());
    if (target == null) {
      return;
    }
    // get prefix change information
    final SubversionPropertyBranchMapper.BranchChangeInfo branches = SubversionPropertyBranchMapper.getBranchChangeInformation(actionData);
    if (!branches.hasChange()) {
      return;
    }
    logger.debug("changing for " + target.getName() + " branch from " + branches.oldBranch + " to " + branches.newBranch + ", and prefix from " + branches.oldPrefix + " to " + branches.newPrefix);
    // change the names of all contained artifacts by replacing the old prefix with the new one
    target.visitAllArtifacts(new Grouping.ArtifactVisitListener() {
      public void visit(Grouping grouping, ArtifactIdentifier oldId) {
        String newName = oldId.getName();
        if (oldId.getName().startsWith(branches.oldPrefix)) {
          newName = branches.newPrefix + oldId.getName().substring(branches.oldPrefix.length());
        }
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

    @Atomic
    public Grouping createOrEditGrouping(ProjectGroupBean bean, ExecutionCourse executionCourse) {
        EnrolmentGroupPolicyType enrolmentPolicyType =
                bean.getAtomicEnrolmentPolicy() != null && bean.getAtomicEnrolmentPolicy() ? new EnrolmentGroupPolicyType(1) : new EnrolmentGroupPolicyType(
                        2);
        Grouping grouping;
        ShiftType shiftType =
                bean.getShiftType() == null || bean.getShiftType().isEmpty() ? null : ShiftType.valueOf(bean.getShiftType());
        if (executionCourse.getGroupingByName(bean.getName()) == null) {
            grouping =
                    Grouping.create(bean.getName(), bean.getEnrolmentBeginDay().toDate(), bean.getEnrolmentEndDay().toDate(),
                            enrolmentPolicyType, bean.getMaxGroupNumber(), bean.getIdealGroupCapacity(),
                            bean.getMaximumGroupCapacity(), bean.getMinimumGroupCapacity(), bean.getProjectDescription(),
                            shiftType, bean.getAutomaticEnrolment(), bean.getDifferentiatedCapacity(), executionCourse,
                            bean.getDifferentiatedCapacityShifts());

        } else {
            grouping = executionCourse.getGroupingByName(bean.getName());
            grouping.edit(bean.getName(), bean.getEnrolmentBeginDay().toDate(), bean.getEnrolmentEndDay().toDate(),
                    enrolmentPolicyType, bean.getMaxGroupNumber(), bean.getIdealGroupCapacity(), bean.getMaximumGroupCapacity(),
                    bean.getMinimumGroupCapacity(), bean.getProjectDescription(), shiftType, bean.getAutomaticEnrolment(),
                    bean.getDifferentiatedCapacity(), bean.getDifferentiatedCapacityShifts());
        }
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

        if (!errors.isEmpty()) {
            model.addAttribute("errors", errors);
            return new TeacherView("insertGroupProperties");
        }

        Grouping grouping = studentGroupService.createOrEditGrouping(projectGroup, executionCourse);
        return new RedirectView("/teacher/" + executionCourse.getExternalId() + "/student-groups/view/"
                + grouping.getExternalId(), true);
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

        final Project project = (Project) FenixFramework.getDomainObject(projectID);
        if (project == null) {
            throw new FenixServiceException("error.noEvaluation");
        }

        final Grouping grouping = (groupingID != null) ? FenixFramework.<Grouping> getDomainObject(groupingID) : null;

        project.edit(name, begin, end, description, onlineSubmissionsAllowed, maxSubmissionsToKeep, grouping, gradeScale,
                departments);
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

        final ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseID);
        if (executionCourse == null) {
            throw new FenixServiceException("error.noExecutionCourse");
        }

        final Grouping grouping = (groupingID != null) ? FenixFramework.<Grouping> getDomainObject(groupingID) : null;

        final Project project =
                new Project(name, begin, end, description, onlineSubmissionsAllowed, maxSubmissionsToKeep, grouping,
                        executionCourse, gradeScale);
        project.getDeparmentsSet().addAll(departments);
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

    public ActionForward sendGroupingEmail(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        String executionCourseCode = request.getParameter("executionCourseID");
        String groupingCode = request.getParameter("groupingCode");
        ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseCode);
        Grouping grouping = FenixFramework.getDomainObject(groupingCode);
        Group groupToSend = GroupingGroup.get(grouping);
        Sender sender = ExecutionCourseSender.newInstance(executionCourse);
        final String label =
                getResources(request, "APPLICATION_RESOURCES").getMessage("label.students.grouping.send.email",
                        grouping.getName());
        Recipient recipient = Recipient.newInstance(label, groupToSend);
        return EmailsDA.sendEmail(request, sender, recipient);
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

    private InfoSiteShiftsAndGroups readShiftAndGroups(String groupPropertiesCode, String shiftCode) throws ExcepcaoInexistente,
            FenixServiceException {

        InfoSiteShiftsAndGroups infoSiteShiftsAndGroups = new InfoSiteShiftsAndGroups();

        Grouping grouping = FenixFramework.getDomainObject(groupPropertiesCode);
        if (grouping == null) {
            return null;
        }

        Shift shift = FenixFramework.getDomainObject(shiftCode);

        List<InfoSiteGroupsByShift> infoSiteGroupsByShiftList = new ArrayList<InfoSiteGroupsByShift>();
        InfoSiteShift infoSiteShift = new InfoSiteShift();
        infoSiteShift.setInfoShift(InfoShift.newInfoFromDomain(shift));

        List allStudentGroups = grouping.readAllStudentGroupsBy(shift);

        if (grouping.getDifferentiatedCapacity()) {
            Integer vagas = shift.getShiftGroupingProperties().getCapacity();
            infoSiteShift.setNrOfGroups(vagas);
        } else {
            if (grouping.getGroupMaximumNumber() != null) {
                int vagas = grouping.getGroupMaximumNumber().intValue() - allStudentGroups.size();
                infoSiteShift.setNrOfGroups(Integer.valueOf(vagas));
            } else {
                infoSiteShift.setNrOfGroups("Sem limite");
            }
        }
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

            FenixServiceException {

        List<InfoSiteStudentsAndShiftByStudentGroup> infoSiteStudentsAndShiftByStudentGroupList =
                new ArrayList<InfoSiteStudentsAndShiftByStudentGroup>();

        Grouping groupProperties = FenixFramework.getDomainObject(groupPropertiesCode);
        if (groupProperties == null) {
            return null;
        }

        Shift shift = FenixFramework.getDomainObject(shiftCode);

        List<StudentGroup> aux = new ArrayList<StudentGroup>();
        List studentGroupsWithShift = groupProperties.getStudentGroupsWithShift();
        Iterator iterStudentGroupsWithShift = studentGroupsWithShift.iterator();
        while (iterStudentGroupsWithShift.hasNext()) {
            StudentGroup studentGroup = (StudentGroup) iterStudentGroupsWithShift.next();
            if (studentGroup.getShift().equals(shift)) {
                aux.add(studentGroup);
            }
        }
        List<StudentGroup> allStudentGroups = new ArrayList<StudentGroup>();
        allStudentGroups.addAll(groupProperties.getStudentGroupsSet());

        Iterator iterAux = aux.iterator();
        while (iterAux.hasNext()) {
            StudentGroup studentGroup = (StudentGroup) iterAux.next();
            allStudentGroups.remove(studentGroup);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.