Package net.sf.pmr.core.domain.user

Examples of net.sf.pmr.core.domain.user.User


         project.setName("name1");
        
        Date date1 = new Date();
        Date date2 = new Date();
       
        User owner = new UserImpl();
        owner.setLogin("login1");
       
       
        // les descriptions sont différentes
        toDo1.setPersistanceId(1);
        toDo1.setDate(date1);
View Full Code Here


     * <li>envoyé au repository</li>
     * </ul>
     */
    public void testAdd() {
     
      User user = new UserImpl();
      user.setPersistanceId(1);
      Project project = new ProjectImpl();
      project.setPersistanceId(2);
     
      toDo.setDescription("réunion!");

View Full Code Here

     * <li>envoyé au repository</li>
     * </ul>
     */
    public void testUpdate() {
     
      User user = new UserImpl();
      user.setPersistanceId(2);
      Project project = new ProjectImpl();
      project.setPersistanceId(3);

      toDo.setProject(project);
      toDo.setOwner(user);
View Full Code Here

     * @param password password
     * @return User or null
     */
    public User login(final String login, final String password) {

        User user = userRepository.findUserByLogin(login);

        // compare the two passwords, if a user is found
        if (user != null && password.equals(user.getPassword())) {
            // if a user is found, the password is remove from the instance variable
            user.setPassword("password not show for security reason");
        } else {
            user = null;
        }

        return user;
View Full Code Here

     * @param password password
     * @return User or null
     */
    public User login(final String login, final String password) {

        User user = userRepository.findUserByLogin(login);

        // compare the two passwords, if a user is found
        if (user != null && password.equals(user.getPassword())) {
            // if a user is found, the password is remove from the instance variable
            user.setPassword("password not show for security reason");
        } else {
            user = null;
        }

        return user;
View Full Code Here

     */
    public Errors addOrUpdate(final int id, final String firstName, final String lastName,
            final String login, final String password, final String email, final long persistanceVersion) {

        // get a user instance from the factory
        User user = CoreObjectFactory.getUser();

        // populate user
        user.setId(id);
        user.setFirstName(firstName);
        user.setLastName(lastName);
        user.setLogin(login);
        user.setPassword(password);
        user.setEmail(email);
        user.setPersistanceVersion(persistanceVersion);

        // validate user
        Errors errors = userValidator.validate(user);

        if (!errors.hasErrors()) {
View Full Code Here

     * @see net.sf.pmr.core.service.UserService#update(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, long)
     */
    public Errors addOrUpdate(final int persistanceId, final String firstName, final String lastName,
            final String login, final String password, final String email, final long persistanceVersion) {

      User user = null;
      Errors errors = null;
     
      if (persistanceId == 0) {
            // get a user instance from the factory
            user = CoreObjectFactory.getUser();
      } else {
        user = userRepository.findUserByPersistanceId(persistanceId);
      }
     
      if (user != null) {

          // populate user
          user.setPersistanceId(persistanceId);
          user.setFirstName(firstName);
          user.setLastName(lastName);
          user.setLogin(login);
          user.setPassword(password);
          user.setEmail(email);
          user.setPersistanceVersion(persistanceVersion);
 
          // validate user
          errors = userValidator.validate(user);
 
          if (!errors.hasErrors()) {
View Full Code Here

        basicProject.setCode(code);
        basicProject.setName(name);
        basicProject.setPersistanceVersion(persistanceVersion);

        // then find the default member in the user repository
        User user = userRepository.findUserById(defaultMemberId);

        // add the user to the set of members
        Set members = new HashSet();
        members.add(user);
        basicProject.setMembers(members);
View Full Code Here

            throws Exception {

        // get the service
        ToDoService toDoService = ToDoObjectFactory.getToDoService();

        User user = (User) request.getSession().getAttribute("user");
       
        // list the todos
        List<ToDo> todos = toDoService.findByProjectPersistanceIdAndUserPersistanceId(
            ((Integer) request.getSession().getAttribute("basicProject.persistanceId")).intValue(), user.getPersistanceId());

        // put in request
        request.setAttribute("toDoList", todos);

        // populate summary
View Full Code Here

            // add
            // get the current basicProject from the session
            Integer basicProjectPersistanceId = (Integer) request.getSession()
                    .getAttribute("basicProject.persistanceId");

            User user = (User) request.getSession().getAttribute("user");
          
            toDoService.add(toDoForm.getDescription(), toDoForm.getDate(), toDoForm.getDone() ,user.getPersistanceId(), basicProjectPersistanceId);
           
        } else {
            // update
          toDoService.update(toDoForm.getPersistanceId(), toDoForm.getPersistanceVersion(), toDoForm.getDescription(), toDoForm.getDate(), toDoForm.getDone());
           
View Full Code Here

TOP

Related Classes of net.sf.pmr.core.domain.user.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.