Examples of Grouping


Examples of org.fenixedu.academic.domain.Grouping

        final Registration registration = Registration.readByUsername(username);
        if (registration == null) {
            throw new InvalidArgumentsServiceException();
        }

        final Grouping grouping = studentGroup.getGrouping();
        final Attends studentAttend = grouping.getStudentAttend(registration);
        if (studentAttend == null) {
            throw new NotAuthorizedException();
        }
        if (studentGroup.getAttendsSet().contains(studentAttend)) {
            throw new InvalidSituationServiceException();
        }

        final IGroupEnrolmentStrategyFactory enrolmentGroupPolicyStrategyFactory = GroupEnrolmentStrategyFactory.getInstance();
        final IGroupEnrolmentStrategy strategy = enrolmentGroupPolicyStrategyFactory.getGroupEnrolmentStrategyInstance(grouping);

        boolean result = strategy.checkPossibleToEnrolInExistingGroup(grouping, studentGroup);
        if (!result) {
            throw new InvalidArgumentsServiceException();
        }

        checkIfStudentIsNotEnrolledInOtherGroups(grouping.getStudentGroupsSet(), studentGroup, studentAttend);

        studentGroup.addAttends(studentAttend);

        informStudents(studentGroup, registration, grouping);
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

        final Collection<Recipient> recipients = new ArrayList<Recipient>();
        recipients.add(recipient);

        Registration registration = Registration.readByUsername(userName);

        Grouping groupProperties = studentGroup.getGrouping();

        Attends attend = groupProperties.getStudentAttend(registration);

        if (attend == null) {
            throw new NotAuthorizedException();
        }

        IGroupEnrolmentStrategyFactory enrolmentGroupPolicyStrategyFactory = GroupEnrolmentStrategyFactory.getInstance();

        IGroupEnrolmentStrategy strategy = enrolmentGroupPolicyStrategyFactory.getGroupEnrolmentStrategyInstance(groupProperties);

        boolean resultEmpty = strategy.checkIfStudentGroupIsEmpty(attend, studentGroup);

        studentGroup.removeAttends(attend);

        if (resultEmpty) {
            studentGroup.delete();
            return Boolean.FALSE;
        }

        final StringBuilder executionCourseNames = new StringBuilder();
        for (final ExecutionCourse executionCourse : groupProperties.getExecutionCourses()) {
            if (executionCourseNames.length() > 0) {
                executionCourseNames.append(", ");
            }
            executionCourseNames.append(executionCourse.getNome());
        }
View Full Code Here

Examples of org.fenixedu.academic.domain.Grouping

public class ReadShiftsAndGroups {

    @Atomic
    public static InfoSiteShiftsAndGroups run(String groupingCode, String username) throws FenixServiceException {

        final Grouping grouping = FenixFramework.getDomainObject(groupingCode);
        if (grouping == null) {
            throw new InvalidSituationServiceException();
        }
        checkPermissions(grouping);
        final IGroupEnrolmentStrategyFactory enrolmentGroupPolicyStrategyFactory = GroupEnrolmentStrategyFactory.getInstance();
View Full Code Here

Examples of xbird.xquery.expr.flwr.Grouping

                jj_la1[61] = jj_gen;
                ;
        }
        switch(jj_nt.kind) {
            case GroupBy:
                Grouping grouping = null;
                grouping = parseGroupByClause();
                flower.setGroupByClause(grouping);
                label_8: while(true) {
                    switch(jj_nt.kind) {
                        case LetVariable:
                            ;
                            break;
                        default:
                            jj_la1[62] = jj_gen;
                            break label_8;
                    }
                    bindings = parseLetClause();
                    grouping.addLetClauses(bindings);
                }
                switch(jj_nt.kind) {
                    case Where:
                        currentToken = jj_consume_token(Where);
                        whereExpr = parseExprSingle();
                        grouping.setWhereExpression(whereExpr);
                        break;
                    default:
                        jj_la1[63] = jj_gen;
                        ;
                }
View Full Code Here

Examples of xbird.xquery.expr.flwr.Grouping

    /************************************************************************
    [47] GroupByClause     ::= "group" "by" GroupingSpecList
    [48] GroupingSpecList ::= GroupingSpec ("," GroupingSpec)*
    ************************************************************************/
    final public Grouping parseGroupByClause() throws ParseException, XQueryException {
        final Grouping grouping = new Grouping();
        GroupingSpec spec = null;
        currentToken = jj_consume_token(GroupBy);
        //GroupingSpecList
        spec = parseGroupingSpec();
        grouping.addGroupingKey(spec);
        label_12: while(true) {
            switch(jj_nt.kind) {
                case Comma:
                    ;
                    break;
                default:
                    jj_la1[76] = jj_gen;
                    break label_12;
            }
            currentToken = jj_consume_token(Comma);
            spec = parseGroupingSpec();
            grouping.addGroupingKey(spec);
        }
        locate(grouping);
        {
            if(true)
                return grouping;
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.