Examples of User


Examples of br.com.caelum.vraptor.musicjungle.model.User

     * This method adds a music to a user's collection.
     */
    @Path("/users/{user.login}/musics/{music.id}")
    @Put
  public void addToMyList(final User user, final Music music) {
      final User sessionUser = refreshUser();
     
      validator.check(user.getLogin().equals(sessionUser.getLogin()),
              new ValidationMessage("user", "you_cant_add_to_others_list"));

      validator.check(!sessionUser.getMusics().contains(music),
              new ValidationMessage("music", "you_already_have_this_music"));

    validator.onErrorUsePageOf(UsersController.class).home();

    musicDao.add(new MusicOwner(user, music));
View Full Code Here

Examples of br.com.caelum.vraptor.mydvds.model.User

     * This method adds a dvd to a user's collection.
     */
    @Path("/users/{user.login}/dvds/{dvd.id}")
    @Put
  public void addToMyList(final User user, final Dvd dvd) {
      final User sessionUser = refreshUser();
      validator.checking(new Validations() {{
        that(user.getLogin(), is(sessionUser.getLogin()),"user", "you_cant_add_to_others_list");
        that(sessionUser.getDvds(), not(hasItem(dvd)), "dvd", "you_already_have_this_dvd");
    }});

    validator.onErrorUsePageOf(UsersController.class).home();

    dao.add(new DvdRental(user, dvd));
View Full Code Here

Examples of br.com.caelum.vraptor.security.User

  @Inject private Permission permission;

  @Override
  protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
    UsernamePasswordToken upToken = (UsernamePasswordToken) token;
    User user = permission.getUserByUsername(upToken.getUsername());
    if (user == null) {
      throw new AuthenticationException();
    }
    return new SimpleAuthenticationInfo(user, user.getPassword(), getName());
  }
View Full Code Here

Examples of br.com.concretesolutions.bootstrap.core.repository.entity.User

  }

  @Override
  public User toEntity() {

    final User user = new User();
    user.setFirstName(firstName);
    user.setLastName(lastName);
    user.setEmail(email);
    user.setLastLogin(lastLogin);
    user.setFailedLoginAttempts(failedLoginAttempts);

    return user;
  }
View Full Code Here

Examples of br.com.mystudies.ds.security.User

      ServiceFactory sf = new ServiceSimpleFactory();

      //--------------------------------------------

      User user = new User();
      user.setGroup(Group.ADMINISTRATORS);

      Service service = sf.getService(user);

      System.out.println(service.execute());


      //----------------------------------------

      user.setGroup(Group.PROGRAMMERS);

      service = sf.getService(user);

      System.out.println(service.execute());
View Full Code Here

Examples of br.com.objectos.rio.User

        .actionDescription("Applying objectos settings to your .gitconfig file.");
  }

  @Override
  protected void execute0(DotsOptions options) {
    User user = etcs.read(User.class);
    Map<String, User> ctx = ImmutableMap.of("user", user);
    Directory userHome = dirs.userHome();

    WayEtc.resourcesAt("/kdo/dots/git")
        .add(".gitconfig")
View Full Code Here

Examples of br.com.objectos.way.etc.model.User

    String text = EtcFiles.readLines("/model/global-usera.yaml");

    Config config = configProvider.get();
    Global res = config.load(text, Global.class);

    User user = res.getUser();
    assertThat(user.getName(), equalTo(USER_A.getName()));
    assertThat(user.getEmail(), equalTo(USER_A.getEmail()));
  }
View Full Code Here

Examples of br.com.six2six.fixturefactory.model.User

    FixtureFactoryLoader.loadTemplates("br.com.six2six.template");
  }

  @Test
  public void fixtureAnyUser() {
    User user = Fixture.from(User.class).gimme("anyValidUser");
    assertNotNull("User should not be null", user);
  }
View Full Code Here

Examples of br.com.visualmidia.business.User

         
          System.out.println("**************** Lista de Usu�rios ******************");
      List<Person> users = (List<Person>) system.query(new GetUsers());
      for (Person person : users) {
        System.out.println("*******************");
        User personType = (User) person.getPersonType("user");
        System.out.println("Usuario: "+personType.getUserName());
        System.out.println("Senha: "+personType.getPassword());
     
      }
      Map<String, Person> persons = (Map<String, Person>)system.query(new GetStudent());

           System.out.println("**************** Lista de Usu�rios ******************");
 
View Full Code Here

Examples of br.eti.kinoshita.testlinkjavaapi.model.User

        return value;
    }

    @SuppressWarnings("unchecked")
  public static final User getUser(Map<String, Object> map) {
      User user = null;
      if (map != null && map.size() > 0) {
        Object o = map.get(TestLinkResponseParams.DB_ID.toString());
        if (o != null) {
          Integer dbID = Integer.parseInt(o.toString());
          if (dbID > 0) {
            user = new User(dbID);
            user.setLogin(getString(map, TestLinkResponseParams.LOGIN.toString()));
            user.setFirstName(getString(map, TestLinkResponseParams.FIRST_NAME.toString()));
            user.setLastName(getString(map, TestLinkResponseParams.LAST_NAME.toString()));
            user.setLocale(getString(map, TestLinkResponseParams.LOCALE.toString()));
            user.setEmailAddress(getString(map, TestLinkResponseParams.EMAIL_ADDRESS.toString()));
            user.setIsActive(getInteger(map, TestLinkResponseParams.IS_ACTIVE.toString()));
            user.setUserApiKey(getString(map, TestLinkResponseParams.USER_API_KEY.toString()));
            user.setLoginRegExp(getString(map, TestLinkResponseParams.LOGIN_REGEXP.toString()));
            user.setTprojectRoles(getInteger(map, TestLinkResponseParams.TPROJECT_ROLES.toString()));
            user.setTplanRoles(getInteger(map, TestLinkResponseParams.TPLAN_ROLES.toString()));
            user.setGlobalRole(getRole((Map<String, Object>) map.get(TestLinkResponseParams.GLOBAL_ROLE.toString())));
            user.setGlobalRoleID(getInteger(map, TestLinkResponseParams.GLOBAL_ROLE_ID.toString()));
            user.setDefaultTestprojectID(getInteger(map, TestLinkResponseParams.DEFAULT_TESTPROJECT_ID.toString()));
          }
        }
      }
      return user;
    }
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.