Package org.libreplan.business.users.entities

Examples of org.libreplan.business.users.entities.User


    @Autowired
    IUserDAO dao;

    @Override
    public String _toString(Object value) {
        User user = (User) value;
        return (user != null)? user.getLoginName() : "";
    }
View Full Code Here


                new EqualsFilter(configuration.getLdapUserId(), username)
                        .toString(), clearPassword);
    }

    private void saveUserOnTransaction(User user) {
        final User userLibrePlan = user;
        transactionService.runOnTransaction(new IOnTransaction<Void>() {
            @Override
            public Void execute() {
                userDAO.save(userLibrePlan);
                return null;
View Full Code Here

    @Override
    @Transactional(readOnly=true)
    public UserDetails loadUserByUsername(String loginName)
        throws UsernameNotFoundException, DataAccessException {

        User user;

        try {
            user = userDAO.findByLoginName(loginName);
        } catch (InstanceNotFoundException e) {
            throw new UsernameNotFoundException(MessageFormat.format(
                    "User with username {0}: not found", loginName));
        }

        Scenario scenario = user.getLastConnectedScenario();
        if (scenario == null) {
            scenario = PredefinedScenarios.MASTER.getScenario();
        }

        return new CustomUser(
            user.getLoginName(),
            user.getPassword(),
            !user.isDisabled(),
            true, // accountNonExpired
            true, // credentialsNonExpired
            true, // accountNonLocked
            getGrantedAuthorities(user.getAllRoles()),
            scenario);
    }
View Full Code Here

        boolean calculateEndDate = (endDate == null);

        // Filter predicate needs to be calculated based on the projects dates
        if ((calculateStartDate) || (calculateEndDate)) {

            User user = orderModel.getUser();
            // Calculate filter based on user preferences
            if (user != null) {
                if ((startDate == null)
                        && !FilterUtils.hasProjectsStartDateChanged()
                        && (user.getProjectsFilterPeriodSince() != null)) {
                    startDate = new LocalDate()
                            .minusMonths(user.getProjectsFilterPeriodSince())
                            .toDateTimeAtStartOfDay().toDate();
                }
                if ((endDate == null)
                        && !FilterUtils.hasProjectsEndDateChanged()
                        && (user.getProjectsFilterPeriodTo() != null)) {
                    endDate = new LocalDate()
                            .plusMonths(user.getProjectsFilterPeriodTo())
                            .toDateMidnight().toDate();
                }
            }
        }
        filterStartDate.setValue(startDate);
View Full Code Here

        if (sessionFilters != null) {
            bdFilters.addSelectedElements(toOrderFilterEnum(sessionFilters));
            return;
        }

        User user = orderModel.getUser();
        // Calculate filter based on user preferences
        if ((user != null) && (user.getProjectsFilterLabel() != null)) {
            bdFilters.addSelectedElement(new FilterPair(OrderFilterEnum.Label,
                    user.getProjectsFilterLabel().getFinderPattern(), user
                            .getProjectsFilterLabel()));
        }
    }
View Full Code Here

                findTasks(each, result);
            }
        }

        public void reassociateResourcesWithSession() {
            User user = UserUtil.getUserFromSession();
            boolean isBoundUser = (user != null) && user.isBound();

            for (Resource resource : resources) {
                if (isBoundUser
                        && user.getWorker().getId().equals(resource.getId())) {
                    // Resource bound to current user is already associated with
                    // session
                    continue;
                }
                resourceDAO.reattach(resource);
View Full Code Here

TOP

Related Classes of org.libreplan.business.users.entities.User

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.