Package org.libreplan.business.common.entities

Examples of org.libreplan.business.common.entities.Configuration


    public boolean isMaxUsersConstraint() {
        return Registry.getTransactionService()
                .runOnAnotherReadOnlyTransaction(new IOnTransaction<Boolean>() {
                    @Override
                    public Boolean execute() {
                        Configuration configuration = Registry
                                .getConfigurationDAO().getConfiguration();
                        if (configuration == null) {
                            return true;
                        }

                        Integer maxUsers = configuration.getMaxUsers();
                        if (maxUsers != null && maxUsers > 0) {
                            List<User> users = Registry.getUserDAO().findAll();
                            int usersNumber = users.size();
                            if (isNewObject()) {
                                usersNumber++;
View Full Code Here


    public boolean isMaxResourcesConstraint() {
        return Registry.getTransactionService()
                .runOnAnotherReadOnlyTransaction(new IOnTransaction<Boolean>() {
                    @Override
                    public Boolean execute() {
                        Configuration configuration = Registry
                                .getConfigurationDAO().getConfiguration();
                        if (configuration == null) {
                            return true;
                        }

                        Integer maxResources = configuration.getMaxResources();
                        if (maxResources != null && maxResources > 0) {
                            List<Resource> resources = Registry
                                    .getResourceDAO().findAll();
                            int resourcesNumber = resources.size();
                            if (isNewObject()) {
View Full Code Here

    }

    public BigDecimal calculateBudgetFromCriteriaAndCostCategories() {
        BigDecimal totalBudget = new BigDecimal(0);

        Configuration configuration = Registry.getConfigurationDAO()
                .getConfiguration();
        TypeOfWorkHours typeofWorkHours = configuration
                .getBudgetDefaultTypeOfWorkHours();
        if (!configuration.isEnabledAutomaticBudget()
                || (configuration.getBudgetDefaultTypeOfWorkHours() == null)) {
            return totalBudget;
        }

        BigDecimal costPerHour = new BigDecimal(0);
        BigDecimal hours = new BigDecimal(0);
View Full Code Here

    /**
     * It returns the login value in function of the property autocompleteLogin.
     */
    public String getLoginValue() {
        Configuration configuration = configurationDAO
                .getConfigurationWithReadOnlyTransaction();
        return ((configuration.isAutocompleteLogin()) && (!configuration
                .getChangedDefaultAdminPassword())) ? this.autocompletLoginValue
                : null;
    }
View Full Code Here

    }

    @Override
    @Transactional(readOnly = true)
    public BaseCalendar getDefaultCalendar() {
        Configuration configuration = configurationDAO.getConfiguration();
        if (configuration == null) {
            return null;
        }
        BaseCalendar defaultCalendar = configuration.getDefaultCalendar();
        forceLoadCalendar(defaultCalendar);
        return defaultCalendar;
    }
View Full Code Here

    }

    @Override
    @Transactional(readOnly = true)
    public BaseCalendar getDefaultCalendar() {
        Configuration configuration = configurationDAO.getConfiguration();
        if (configuration == null) {
            return null;
        }
        BaseCalendar defaultCalendar = configuration
                .getDefaultCalendar();
        forceLoadCalendar(defaultCalendar);
        return defaultCalendar;
    }
View Full Code Here

        messagesForUser = new MessagesForUser(messagesContainer);
    }

    @Override
    protected String getReportName() {
        Configuration configuration = Registry.getConfigurationDAO()
                .getConfigurationWithReadOnlyTransaction();
        if (configuration != null && configuration.isEnabledAutomaticBudget()) {
            return REPORT_WITH_HOURS_BUDGET_NAME;
        } else {
            return REPORT_NAME;
        }
    }
View Full Code Here

    }

    @Override
    @Transactional(readOnly = true)
    public BaseCalendar getDefaultCalendar() {
        Configuration configuration = configurationDAO.getConfiguration();
        if (configuration == null) {
            return null;
        }
        BaseCalendar defaultCalendar = configuration
                .getDefaultCalendar();
        forceLoadCalendar(defaultCalendar);
        return defaultCalendar;
    }
View Full Code Here

            connector.getProperties().size();
        }
    }

    private Configuration getCurrentConfiguration() {
        Configuration configuration = configurationDAO.getConfiguration();
        if (configuration == null) {
            configuration = Configuration.create();
        }
        forceLoad(configuration);
        return configuration;
View Full Code Here

                            type);
        }
    }

    private void checkIsPersonalTimesheetsTypeOfWorkHours(TypeOfWorkHours type) {
        Configuration configuration = configurationDAO.getConfiguration();
        if (configuration.getPersonalTimesheetsTypeOfWorkHours().getId()
                .equals(type.getId())) {
            throw ValidationException
                    .invalidValueException(
                            "Cannot delete the type of work hours. It is configured as type of work hours for personal timesheets.",
                            type);
View Full Code Here

TOP

Related Classes of org.libreplan.business.common.entities.Configuration

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.