Package org.libreplan.business.scenarios.entities

Examples of org.libreplan.business.scenarios.entities.Scenario


        }
    }

    private List<Scenario> currentAndDerivedScenarios() {
        List<Scenario> scenariosToBeDisassociatedFrom = new ArrayList<Scenario>();
        Scenario currentScenario = scenarioManager.getCurrent();
        scenariosToBeDisassociatedFrom.add(currentScenario);
        scenariosToBeDisassociatedFrom.addAll(scenarioDAO
                .getDerivedScenarios(currentScenario));
        return scenariosToBeDisassociatedFrom;
    }
View Full Code Here


    public class ScenariosTreeitemRenderer implements TreeitemRenderer {

        @Override
        public void render(final Treeitem item, Object data) {
            SimpleTreeNode simpleTreeNode = (SimpleTreeNode) data;
            final Scenario scenario = (Scenario) simpleTreeNode.getData();
            item.setValue(data);

            Scenario currentScenario = scenarioManager.getCurrent();
            boolean isCurrentScenario = currentScenario.getId().equals(
                    scenario.getId());

            Treerow treerow = new Treerow();

            Treecell nameTreecell = new Treecell();
View Full Code Here

        for (Scenario root : rootScenarios) {
            result.put(root, new ArrayList<Scenario>());
        }

        for (Scenario derived : derivedScenarios) {
            Scenario parent = derived.getPredecessor();
            List<Scenario> siblings = result.get(parent);

            if (siblings == null) {
                siblings = new ArrayList<Scenario>();
                siblings.add(derived);
View Full Code Here

                            + "if the scenario on which to work on is not explicitly specified");
        }

        @Override
        protected Collection<T> getUnorderedAssignments() {
            Scenario scenario = currentScenario();
            return retrieveOrCreateContainerFor(scenario).getDayAssignments();
        }
View Full Code Here

    private class NotSpecifiedScenarioState extends DayAssignmentsState {

        @Override
        protected Collection<DerivedDayAssignment> getUnorderedAssignments() {
            Scenario current = Registry.getScenarioManager().getCurrent();
            DerivedDayAssignmentsContainer container = byScenario()
                    .get(current);
            if (container == null) {
                return new ArrayList<DerivedDayAssignment>();
            }
View Full Code Here

    private BaseCalendar baseCalendar;
    private Task task;

    private static Scenario mockScenario() {
        Scenario result = createNiceMock(Scenario.class);
        replay(result);
        return result;
    }
View Full Code Here

    private void createOrder(
            final SubcontractedTaskDataDTO subcontractedTaskDataDTO,
            final ExternalCompany externalCompany,
            final OrderElementDTO orderElementDTO) throws ViolationError{
        Scenario current = Registry.getScenarioManager().getCurrent();
        OrderVersion version = OrderVersion.createInitialVersion(current);
        OrderElement orderElement = OrderElementConverter.toEntity(version,
                orderElementDTO,
                ConfigurationOrderElementConverter.noAdvanceMeasurements());
View Full Code Here

    public final static OrderElement toEntity(OrderVersion orderVersion,
            OrderElementDTO orderElementDTO,
            ConfigurationOrderElementConverter configuration) {

        if (orderVersion == null) {
            Scenario current = Registry.getScenarioManager().getCurrent();
            orderVersion = OrderVersion.createInitialVersion(current);
        }
        OrderElement orderElement = toEntityExceptCriterionRequirements(
                orderVersion, orderElementDTO, configuration);
View Full Code Here

        } else { // orderElementDTO instanceof OrderLineGroupDTO

            if (orderElementDTO instanceof OrderDTO) {
                checkOrderElementDTOCode(orderElementDTO, "OrderDTO");
                orderElement = Order.createUnvalidated(orderElementDTO.code);
                Scenario current = Registry.getScenarioManager().getCurrent();
                ((Order) orderElement).setVersionForScenario(current,
                        parentOrderVersion);
                ((Order) orderElement)
                        .setDependenciesConstraintsHavePriority(((OrderDTO) orderElementDTO).dependenciesConstraintsHavePriority);
                List<BaseCalendar> calendars = Registry.getBaseCalendarDAO()
View Full Code Here

    @Override
    @Transactional
    public void setScenario(String loginName, Scenario scenario,
            IOnFinished onFinish) {
        Scenario scenarioReloaded = reloadScenario(scenario);
        associateToUser(scenarioReloaded, findUserByLoginName(loginName));
        doReassignations(scenarioReloaded, onFinish);
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.scenarios.entities.Scenario

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.